• Keep selected documents(IDs) when paging

    By Ulrich Krause 1 decade ago

    I took a look at the CheckBoxBean in the teamroom template. I expected that this would be what I needed for my view.

    What I want to achieve is that when I switch from page 1 to page 2 and have selected some docs on page 1, that using the bean it would keep all selected ids from page one when paging thru the view back and forth.

    But this is not the case. When I switch back to page 1 from page 2, all my selection is lost.

    Did I get it completely wrong or isn't that what the bean is made for?

    • CheckBoxBean...

      By Tony McGuckin 1 decade ago

      Hi Ulrich,

      The CheckBoxBean is currently set for view scope.  In the TeamRoom use case the design requirements specified that only checked rows should be persisted for the currently displayed page, just in-case a user selected several rows across different pages and subsequently deleting more rows than expected. The TeamRoom members area also uses nested DynamicContent controls that therefore completly swap out the state of the CheckBoxBean during transitions.  In a simpler use case, the CheckBoxBean would be preserving its state otherwise.

      Also take a look at the following XSnippet I put up... it demonstrates the in-built row selection mechanism that you could also leverage to obtain selected rows:

      http://openntf.org/XSnippets.nsf/snippet.xsp?id=simple-trash-folder-cw-selectable-rows-restore-functionality

      Thanks,

      Tony

      • does not solve the problem

        By Ulrich Krause 1 decade ago

        thx for response.

        So, if I understand correct, the chekBoxBean will preserve the selected rows across pages.

         

        My usecase :

        User filter a view using search crtiteria; the result should be exported to Excel using Apache POI. The result can still contain docs that should not be included in the Exxcel file. So the user selects only specific documents from the resultset To avoid scrolling thru large resultsets I have used a pager.

        What we now need is a method to keep the selection persitent on page change. At the moment, we can only export docs from one page. Changing to another page deletes the prior selection.