You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Thierry Templier <te...@yahoo.fr> on 2006/11/07 11:08:56 UTC
Problem with dataTable with Tomcat 5.5 and MyFaces 1.1.4
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
Re: Problem with dataTable with Tomcat 5.5 and MyFaces 1.1.4
Posted by Thierry Templier <te...@yahoo.fr>.
Hello Martin,
Thanks a lot for your response. It is really a stupid
error!!
Thierry
> Hi Thierry,
>
> you have a small mistake in your JSP - you need to
> replace
>
> <column>
> </column>
>
> with:
>
> <h:column>
> </h:column>
>
> regards,
>
> Martin
Take a look at my blog:
http://jroller.com/page/Templth/
(old: http://templth.blogspot.com/)
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com
Re: Problem with dataTable with Tomcat 5.5 and MyFaces 1.1.4
Posted by Martin Marinschek <ma...@gmail.com>.
Hi Thierry,
you have a small mistake in your JSP - you need to replace
<column>
</column>
with:
<h:column>
</h:column>
regards,
Martin
On 11/7/06, Thierry Templier <te...@yahoo.fr> wrote:
> 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
>
--
http://www.irian.at
Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German
Professional Support for Apache MyFaces