0

Need activePage not 0 support for MVVM Intermediate Paging

asked 2013-07-13 00:06:38 +0800

turbo gravatar image turbo
1

ZK needs to support the use case of when the activePage does not initialize to 0 when using the paging component with MVVM. This would simply require for setTotalSize() to be called before setActivePage(). setActivePage() gets called first during MVVM and only allows for 0 since totalSize during construction is 1. The direct Java constructor already handles this by calling setTotalSize() first, but via MVVM, it does not. I tried to hack it by creating my own IntermediatePaging class which extends Paging, but the @save direction did not work.


USE CASES

  1. User wants to bookmark search results of page >1 or share URL with other person.
  2. Our paging of overview items resolve to new page of detailed items where the pageSize=1, but user can easily page from e.g. item 33 to item 34.
  3. Show full list of items, but previous page search wants to jump to page 50 to highlight item while showing relative position in paged list.

Simply, this should not throw an exception (assuming we have the data):

<paging pageSize="10" totalSize="100" activePage="33"/>

For my case and VM matching numbers above:

<paging pageSize="@load(searchvm.pageSize)" totalSize="@load(searchvm.totalSize)" activePage="@bind(searchvm.activePage)" onPaging="@command('onPaging')"/>
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-08 04:29:24 +0800

benbai gravatar image benbai
2228 6
http://www.zkoss.org

There is an similar issue: ZK-1696, currently you can use a custom component as a workaround as below:

  1. separate "page specified by user" and "page assigned to component"
  2. when total size assigned, fix the "page assigned to component" with "page specified by user"
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-07-13 00:06:38 +0800

Seen: 18 times

Last updated: Jan 08 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More