Revision history [back]

click to hide/show revision 1
initial version

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

chillworld gravatar image chillworld flag of Belgium

https://github.com/chillw...

listbox with groupsmodel and paging

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>

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?

Greetz chill.

listbox with groupsmodel and paging

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.

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