Revision history [back]

click to hide/show revision 1
initial version

asked 2012-10-24 14:26:29 +0800

rickcr gravatar image rickcr

Listbox - using template - how can I get the previous "row" so can use in logic for current row????

I know how to these kinds of things in old-skool JSP with EL, but having difficulty finding examples of this with ZK.

I'm using a template, as described in most of the current examples, but since I don't see iterations and I'm not sure how to integrate some kind of "c:set " concept between iterations, I'm not sure how I go about setting the previous value in scope so I can make decisions on how to display the next iteration? For example rather than see a list like:

[CODE] Mammal Squirrel Mammal Fox Mammal Raccoon Bird Hawk Bird Sparrow [/CODE]

I want to hide the first column display if it was previously set so that it looks like:

[CODE] Mammal Squirrel Fox Raccoon Bird Hawk Sparrow [/CODE]

But how do I do this within the following type of code:

[CODE] <listbox model="@bind(vm.animals)" selecteditem="@bind(vm.selectedAnimal)" vflex="true"> <template name="model" var="animal"> <listitem> <listcell label="@bind(animal.class)" visible="${previous.class" ne="" animal.class}&gt;<="" listcell="">

        <listcell label="@bind(animal.family)"></listcell>
    </listitem>
</template>

</listbox> [/CODE]

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