Hi all:

I am having trouble getting command links to work correctly when I use tomahawk's <t:dataTable for scrolling and sorting. Briefly, the rowIndex doesn't seem to be correct: I have breakpoints in my code which shows me that while rowCount is correctly computed, for some reason rowIndex seems to be incorrectly computed according to the foll. pattern:

1. Page 1 has rows 1 to 5, the rowIndex for all the links in this page is 4.
2. Page 2 has rows 6 to 10, the rowIndex for all the links in this page is 9.
3. Page 3 has rows 11 to 15 ,..and yep,.. rowIndex for everything here is 14.

int rowCount = assignmentsModel.getRowCount();
int rowIndex = assignmentsModel.getRowIndex();

However if I forget about the scrolling/sorting features everything is calculated properly.

Details: I downloaded the brand new MyFaces1.1.1 just today. Also, my worklist bean (extends Shale's AbstractViewController) has request scope, and STATE_SAVING_METHOD is server, returns a ListDataModel  for its getAssignments() method.

More details:
My jsp code pretty much follows what is in the "simple" examples pagedSortTable.jsp:

<h:form id="form1">
        <t:saveState id="worklist" value="#{worklist}" />
        <t:dataTable
                id="items"
                styleClass="scrollerTable"
                headerClass="standardTable_Header"
                footerClass="standardTable_Header"
                rowClasses="standardTable_Row1,standardTable_Row2"
                columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
                var="assignment"
                value="#{worklist.assignments}"
                preserveDataModel="true"
                rows="5"
                rowId="#{assignment.activityKey}"
                sortColumn="#{worklist.sort}"
                sortAscending="#{worklist.ascending}"
                preserveSort="true"
                >

        <h:column>
                        <f:facet name="header">
                                <t:commandSortHeader columnName="name" arrow="true" immediate="false">
                                        <h:outputText value="Assignment" />
                                </t:commandSortHeader>
                        </f:facet>
                        <h:commandLink rendered="#{assignment.startPhoneAssignment}"
                                action="#{worklist.acceptPhoneAssignment}" immediate="false">
                                <h:outputText value="#{assignment.activityKey}" />
                        </h:commandLink>
                </h:column>

etc.

thanks very much for all help!
Geeta

Reply via email to