0

listbox with groupsmodel and paging

asked 2015-01-16 07:04:03 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

updated 2015-01-16 07:24:02 +0800

Hi all,

I'm currently busy with a listbox with paging and who contains a groupsmodel.

zul

<window mode="modal" title="Double booking moves" closable="true" position="center" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('be.chillworld.web.vm.participant.DoubleBookingVM')" width="70%" height="80%">
  <listbox id="theGrid" model="@bind(vm.movements)" emptyMessage="No data" mold="paging" pageSize="5">
    <listhead>
      <listheader label="Move type" sort="auto" />
      <listheader label="Start date" />
      <listheader label="End date" />
    </listhead>
    <template name="model:group">
      <listgroup label="@load(each)" />
    </template>
    <template name="model" var="move">
      <listitem>
        <listcell label="@load(move.moveType.description)" />
        <listcell label="@load(move.effectifStartDate) @converter('formatedDate',format='dd/MM/yyyy HH:mm')" />
        <listcell label="@load(move.effectifEndDate) @converter('formatedDate',format='dd/MM/yyyy HH:mm')" />
      </listitem>
    </template>
  </listbox>
</window>

Part 1 :

What I want is that the list show's me a full group in each page.
A group consist's of a participant and entries of double booking.(in compare of the booking we are making)
Normally this should be 1, but of course I leave an option to make the double booking.
So sometimes there could be 2 entries.

If I set the pagesize for example 5 and the double booked participants has 1 double booking => I get the group as last entry and the data as first entry of second page.(So you can't see all the data in 1 page and you must change page to see the whole entry)

If I set pageSize to 10, same thing if there is one with 2 double bookings.

Is there some solution for this problem?

Part 2 :

Because I need to have the option open for create the booking, even if it's double, I need to able to select only the group.
I know how to do it with the rowrenderer, but is this also possible from the zul?
The details of the double booking, I don't need to select. (Because it's the participant who will be booked and not the booking itself)
Again, someone knows how to implement this in the zul?

Greetz chill.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-01-18 20:15:12 +0800

Darksu gravatar image Darksu
1991 1 4

Hello chillworld,

Most probably you have to use the paging component that zk provides, and set its values based on your business rules.

For example the page size will be set depending on the groups and not the actual items that you have.

Best Regards,

Darksu

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: 2015-01-16 07:04:03 +0800

Seen: 23 times

Last updated: Jan 18 '15

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