Hello all,
I am having some difficulties with t:DataTable and
t:commandSortHeader: they do not sort my data. I have a bean named
"expList" saved in the session, and I have programmed a sort method
following the MyFaces examples. But I found whenever I click the
command sort header, the "sort" function is simply not called.

My steps to uses the sortable table are:
1. define a List data member called list in my expList class/object
2. define a sort function to sort the list based on sort  solumn and
ascending attribute
3. populate the expList and save it in the session;

My JSP is like the following:

        <h:form>
                <t:dataTable id="data" var="exp"
                  value="#{expList.list}"
                  sortColumn="#{expList.sort}"
                  sortAscending="#{expList.ascending}"
                  preserveDataModel="true"
                  preserveSort="true">
                        <h:column>
                        <f:facet name="header">
                                <t:commandSortHeader columnName="id" 
arrow="true"
                                  immediate="false">
                                        <h:outputText value="id" />
                                </t:commandSortHeader>
                        </f:facet>
                                <h:outputText value="#{exp.id}" />
                        </h:column>
                        <h:column>
                                <f:facet name="header">
                                        <t:commandSortHeader 
columnName="expDesign" arrow="true"
                                          immediate="false">
                                                <h:outputText value="design" />
                                        </t:commandSortHeader>
                                </f:facet>
                                <h:outputText value="#{exp.expDesign}" />
                        </h:column>
                </t:dataTable>
        </h:form>

Any problems with my understanding of t:Datatable and t:commandSortHead?
Thanks!

Qiang

Reply via email to