Issue Details (XML | Word | Printable)

Key: OF-168
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Dmitry Pikhulya
Reporter: Calin Jebelean
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenFaces

The o:dataTablePaginator for custom-paginated o:dataTable does not work as expected

Created: 26/Jan/12 02:59 PM   Updated: 26/Jan/12 02:59 PM
Component/s: None
Affects Version/s: OpenFaces 3.0.EA1
Fix Version/s: None

Environment:
Windows 7 32-bit as OS, Eclipse as IDE, Tomcat 6.0.30 as application server.
Openfaces 3.1.EA1.790 (the latest nightly build that I could download)
MyFaces 2.1.5


 Description  « Hide
Hi,

I'm migrating a quite large application from JSF 1.2 to JSF 2. The application has previously functioned with Openfaces 2 (not the official version, but some nightly build) and MyFaces 1.2.9, everything was ok.

During migration, I've changed the MyFaces version to 2.1.5 and the Openfaces version to 3.0 and then to 3.1.EA1.790 (because the 3.0 threw some exception during Tomcat startup). Anyway, all the tables that we have (and there are many of them) started to misbehave: the dataTablePaginator is not able to move through pages anymore. It displays Page 1 of 25 and no matter how many times I click on the Next and Last buttons, it stays on the same page.

Then I've discovered the issue with the "id" for the paginator component. I've added an "id" for the paginator and those tables that didn't have custom pagination started to work. But the tables that have custom pagination still don't work. Upon investigation, I've discovered that the code:

  Integer pageStart = Faces.var("pageStart", Integer.class);

which is called as soon as the dataTablePaginator's "Next" button is clicked, does never produce any other value than 0. We use the resulted "pageStart" variable to determine what page the dataTable wants to render, so we can provide the necessary data. However, since it always returns 0, the first page is displayed over and over again.

The xhtml code is something like:

    <o:dataTable id="listDetails"
                 var="item"
                 rowKey="#{item.id}"
                 value="#{itemBean.resultedItems}"
                 styleClass="dataTable"
                 pageSize="#{activeBean.pageSize}"
                 customDataProviding="true"
                 totalRowCount="#{activeBean.itemCount}"
                 rowDataByKey="#{activeBean.itemByKey}"
                 pageIndex="#{activeBean.itemPageIndex}"
                 binding="#{activeBean.itemListTable}">
        <o:scrolling horizontal="true"/>
        <o:columnResizing resizeHandleWidth="10px" minColWidth="50px"/>
        <o:columnReordering/>
        <f:facet name="noDataMessage">
            <h:outputText value="#{messages.msg_no_records}" />
        </f:facet>
        <f:facet name="below">
            <o:dataTablePaginator id="paginator"
             styleClass="pagination"
                                pageCountPreposition="#{messages.msg_page_count_preposition}"
                                pageNumberPrefix="#{messages.msg_page_number_prefix}"
                                showIfOnePage="true"/>
        </f:facet>
    ....
    </o:dataTable>

So the main issue here I think is the fact that the call Faces.var("pageStart", Integer.class) always returns 0 when invoked as a result of clicking the "Next" button in the o:dataTablePaginator. The same xhtml and bean code used to work on MyFaces 1.2 and Openfaces 2.0. Is there something that we are doing the wrong way? Can you please share your thought on this subject?

Thank you for your time.

Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.