Werner Punz wrote:
Since nobody answers I try to reformulate the question differently.
The datascroller basically uses the pageIndexVar to set the position.
If I scroll everything is fine.
But as soon as I do a form submit outside of the datascroller,
the pageIndex var is reset to the first position.
My question is, is there a way to prevent this reset of the scroller
page index? x:saveState does not seem to work in this case.
Werner
Ok I have solved it myself...
You can reference the pageCount variable by messing directly with the
request map.
Following scenario is possible...
You can access the pageCount variable from the scroller the following way:
Object scrollerState = ...getRequest().getAttribute("pageCount");
(your pagecount Variable name may vary)
at the restore attributes phase (basically at the backend bean creation
time if you are in the request scope)
You can then store it away in the session or a cache
and once you trigger an operation which needs a saved state of the
scroller you can push the last page count from your cache back
into the request by using the setAttribute.
This solution is somewhat messy, but it works.
There would be a possible szenario with a pageCount controller backend
bean with a session scope, which could to the storing and expose a
preserveState method, which pushes the pageCount back from the stack
into the request.