The bean has session scope in faces-config.xml.

Here's my real code. row.getCols() is really row.getShifts().
row.getShifts() doesn't get called in the debugger if I just have
<t:columns var="col" value="#{row.shifts}">.  However, if I uncomment
out <t:outputText value="#{row.shifts}"/>, the row.getShifts() does get
called in the debugger.  So, I know row.shifts is valid.  The List
referred to by row.shifts contains objects that have name and value
fields.

The docs on <t:saveState> aren't clear how to use it, although after
reading the description, I don't think I need it if my bean (searchForm)
is in session scope.

<t:dataTable var="row" value="#{searchForm.list}"
preserveDataModel="true" styleClass="table"
             headerClass="tableHeader" rowClasses="evenRow,oddRow"
rendered="#{!empty searchForm.list}">
    <t:column style="width:40px; border:0px solid lightgrey;
border-bottom-width:1px">
        <f:facet name="header"><h:outputText value="id"/></f:facet>
        <h:outputText value="#{row.id}"/>
    </t:column>

    <%--<t:column style="width:200px; border:0px solid lightgrey;
border-bottom-width:1px">
        <f:facet name="header"><h:outputText value="test"/></f:facet>
        <t:outputText value="#{row.shifts}"/>
    </t:column>--%>

    <t:columns var="col" value="#{row.shifts}">
        <f:facet name="header"><h:outputText
value="#{col.name}"/></f:facet>
        <t:outputText value="#{col.value}"/>
    </t:columns>

</t:dataTable>

-----Original Message-----
From: Mike Kienenberger [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 18, 2006 2:34 PM
To: MyFaces Discussion
Subject: Re: t:columns and iterating through row objects that contain
list of column objects.

Is #{bean.rows} preserved between requests?   Ie, is bean either
session-scope or application scope, or are you using t:saveState on
bean.rows?

I handle it by using t:saveState on bean.rows.

If the data model is preserved, then the thing to do is to set a
breakpoint on row.getCols and make sure it's being called and
returning the correct results.
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Click here for important additional terms relating to this 
e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------

Reply via email to