I just started working with myFaces (and tomahawk) for the past couple of days and so I apologize if this question is really basic.

Here's what I have:

A (Shale) backing bean called "worklist" with:
private DataModel assignmentsModel = new ListDataModel();
..etc..
private List _assignments;
..etc..
public String getWorkList() {
        //do some work to populate_assignments ..then..
        assignmentsModel.setWrappedData(_assignments);
}
finally,
public DataModel getAssignments() {
        return assignmentsModel;
}

I display my worklist in worklist.jsp and everything works great.

Now I want to introduce sorting into my table and therefore looked into <t:commandSortHeader  working within a <t:dataTable. I think I'm supposed to have something like this in my worklist.jsp:

<t:dataTable id="items" value="#{worklist.assignments}"
                var="assignment" sortColumn="#{worklist.sort}"
                sortAscending="#{worklist.ascending}" preserveDataModel="true"
                preserveSort="true">

                <h:column>
                        <f:facet name="header">
                                <t:commandSortHeader columnName="name" arrow="true">
                                        <h:outputText value="Assignment" />
                                </t:commandSortHeader>
                        </f:facet>
etc..

So I added methods getSort(), isAscending(), sort (final String column, final boolean ascending) etc. to my worklist backingbean (using sample code from MyFaces' "listexample" as a guide). My worklist.jsp page does display with the little arrow but clicking on it returns me to the same page (though the arrow faces the opposite way upon click - yeah!!), however, no sorting happens, which is no major surprise since my bean's sorting method isn't even hit..(:(

So my questions are:
0. Is my approach all wrong and should Ibe doing everything differently?
1. Does anybody see what i'm doing wrong?
2. Where should I add breakpoints to see what I'm messing up? (My code doesn't even hit the sort method in my backing bean.)

Thanks very much in advance!
Geeta

Reply via email to