Search code examples
javajsf-2richfaces

Server side listener for rich:dataScroller (RF 4.1)


I'm using an extendedDataTable because I need multiselect. The table can get pretty large, so I'm using a dataScroller for paging.

What I want to achieve is, that the selection is cleared when switching to another page. The selection is stored in the backing bean and I have a method clearTableSelection to clear the selection.

Now my question is, how is it possible to call the method clearTableSelection when switching pages.


Solution

  • I found a simple solution:

    ...
    <rich:extendedDataTable>
        ...
        <f:facet name="footer">
            <rich:dataScroller 
                onbegin="document.getElementById('form:hiddenButton').click()" />
        </f:facet>
    </rich:extendedDataTable>
    <a4j:commandButton 
        id="hiddenButton" action="#{backingBean.clearTableSelection}"
        value="HiddenButton" execute="@this" style="display: none;" />
    ...