> > I'm trying to get the MyFaces dataTable to sort my columns. Getting
> > to show up my data was no problem so I think I'm on the right way.

I think you have to provide your own sort method, which sorts the data list
according to the sortAscending and sortColumn attribute values before the
data list is returned by its getter method.


Regards,

Matthias

> -----Ursprüngliche Nachricht-----
> Von: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Auftrag
> von Dave Brondsema
> Gesendet: Dienstag, 28. Februar 2006 14:48
> An: MyFaces Discussion
> Betreff: Re: MyFaces dataTable column sorting
>
>
> See the tomahawk examples, there's a good example of t:dataTable
>
> sortColumn, and sortAscending should bind to getters/setters for a
> String and boolean.
>
> Malone, Daniel wrote:
> > Hi,
> >
> > I'm trying to get the MyFaces dataTable to sort my columns. Getting
> > to show up my data was no problem so I think I'm on the right way.
> >
> > I'm not sure what the two attributes "sortColumn" and "sortAscending"
> > mean.
> > I know that a String and a boolean is expected but that's about it.
> > Maybe
> > someone can help me out.
> >
> > I had a look at the examples on Irian.com but they don't help very much.
> >
> > Is more for looking at.
> >
> > I'm thankful for any hint.
> >
> > JSP Page Code
> >
> > <t:dataTable
> >     id="tbUsers"
> >     var="user"
> >     value="#{Results.list}"
> >     sortColumn="#{Results.sort}"
> >     sortAscending="#{Results.ascending}">
> >
> >     <t:column>
> >             <f:facet name="header">
> >                     <t:commandSortHeader columnName="nr">
> >                             <outputText value="nr" />
> >                     </t:commandSortHeader>
> >             </f:facet>
> >             <h:outputText value="#{user.nr}"/>
> >     </t:column>
> >     <t:column>
> >             <f:facet name="header">
> >                     <t:commandSortHeader columnName="status">
> >                             <h:outputText value="Status" />
> >                     </t:commandSortHeader>
> >             </f:facet>
> >             <h:outputText value="#{user.status}" />
> >     </t:column>
> >
> >     ...
> >
> > </t:dataTable>
> >
> > Best regards,
> >
> > Daniel Malone
> >
>
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>

Reply via email to