3

I have a question on a piece of functionailty I need to add to dataTable / dataScroller components.

I have the following code:

<a4j:outputPanel id="renderArea">
    <rich:dataTable id="mainDataTable">
        ......
        <rich:column>
            <h:commandButton value="Add" action="#{myBean.addItem}" reRender="myDataScroller, mainDataTable"/>
        </rich:column>
    </rich:dataTable>
</a4j:outputPanel>


<a4j:outputPanel id="PTScroll">
    <h:panelGrid>
        <rich:datascroller for="mainDataTable" id="myDataScroller" maxPages="20" renderIfSinglePage="false" />
    </h:panelGrid>
</a4j:outputPanel>

So when the user is on the second/third/etc paginated page of the table, and they add an item via the action="#{myBean.addItem}" action. I want the dataTable/dataScroller to reRender and return to the first page of my Table.

Is there a quick simple way to do this in my jsf code?

Thanks

Thomas Buckley
  • 5,836
  • 19
  • 62
  • 110
  • The answer to this question, which also happens to be the **workaround for a "page not resetting" problem for richfaces is here: https://community.jboss.org/message/616893#616893** – acdcjunior Jan 29 '14 at 13:58

1 Answers1

1

rich:datascroller has a page attribute, it should work.

If page >= 1 then it's a page number to show

Adam
  • 5,045
  • 1
  • 25
  • 31