0

zk 6 bind and EL if

asked 2012-08-11 12:45:10 +0800

jaan gravatar image jaan
88 3

Hi,

I try to show only some of the items in a set in my zul-page.
I want to achieve this goal in EL.

I have something like:

<listbox model="@load(vm.usertypes)" multiple="true" checkmark="true" sclass="checklist"   selectedItems="@bind(vm.selectedUsertypes)">
				<template name="model" var="pt">
					<listitem if="@load(pt.category eq 'Personnel')">
						<listcell label="@load(pt.name)" />
					</listitem>
				</template>
			</listbox>


I recieve this error: The model template must have exactly one item, not 0.
Is it possible to show some of the items (based on the usertype-category) via EL expressions?

Thanks,
jaan

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-08-11 14:30:37 +0800

Jales gravatar image Jales
161 1

What you need to do is load it from the database based on the usertype-category, not load all of them and then filter it based on the usertype-category.

Or, if you cannot do it for some reason, just filter it before you set it as the model.

link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2012-08-11 12:45:10 +0800

Seen: 137 times

Last updated: Aug 11 '12

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