Hello,
I try to use a dataTable with MyFaces 1.1.4 in a
Tomcat server 5.5.17.
Everything works correctly (the component is added to
the page and the header is specified) except that the
datas of the line aren't displayed.
I have looked at the source code of the page and it
seems nevertheless that the component iterates the
list of the model (there are two items in this list):
<table id="_id0:data">
<thead>
<tr><th scope="colgroup" colspan="0"
class="tableHeader">Id</th></tr></thead>
<tbody id="_id0:data:tbody_element">
<tr class="oddRow"></tr>
<tr class="evenRow"></tr>
</tbody>
</table>
Here is the code of my jsp:
<%@ taglib uri="http://java.sun.com/jsf/html"
prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core"
prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk"
prefix="t"%>
<f:view>
<h:form >
<t:dataTable id="data" value="#{liste.liste}"
var="element"
rowClasses="oddRow, evenRow"
headerClass="tableHeader">
<column>
<f:facet name="header">
<h:outputText value="Id"/>
</f:facet>
<h:outputText id="tmp"
value="#{element.id}"/>
</column>
</t:dataTable>
</h:form>
</f:view>
and the code of my managed bean:
public class ListeControleur {
private DataModel liste = new ListDataModel();
public ListeControleur() {
List tmpListe = new ArrayList();
Element e1 = new Element();
e1.setId(1);
e1.setLibelle("Libelle1");
tmpListe.add(e1);
Element e2 = new Element();
e2.setId(2);
e2.setLibelle("Libelle2");
tmpListe.add(e2);
liste.setWrappedData(tmpListe);
}
public DataModel getListe() {
return liste;
}
}
Thanks you very much by advance for your help.
Thierry
Take a look at my blog:
http://jroller.com/page/Templth/
(old: http://templth.blogspot.com/)
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses
http://fr.answers.yahoo.com