0

How to set initial item selection in a MVVM listbox with mold as 'select'?

asked 2012-06-04 08:42:55 +0800

davout gravatar image davout
1435 3 18

I can't work out how to set the initial selected item in a 'select' mold Listbox using MVVM.

When I use...
... from the MVVM class...

	private ListModelList<TitledDO> fDurationIntervalModel;
	private TitledDO fDurationIntervalSelected;



... from the ZUL file...
<listbox
	model="@load(vm.durationIntervalModel)" mold="select" 
	selectedItem="@bind(vm.durationIntervalSelected)">
	<template name="model" var="d">
  	     <listitem>
		<listcell label="@load(d.title)" />
   	     </listitem>
	</template>
</listbox>



.. if I try setting the fDurationIntervalSelected property inside the MVVM class then I get an error..

SEVERE: >>org.zkoss.zel.PropertyNotFoundException: Property 'durationIntervalSelected' not readable on type com.eis.zk.dataobject.TitledDO
>> at org.zkoss.zel.BeanELResolver$BeanProperty.read(BeanELResolver.java:348)
>> at org.zkoss.zel.BeanELResolver$BeanProperty.access$000(BeanELResolver.java:274)
>> at org.zkoss.zel.BeanELResolver.getValue(BeanELResolver.java:85)
>> at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
>> at org.zkoss.zel.CompositeELResolver.getValue(CompositeELResolver.java:67)
>> at org.zkoss.xel.zel.XelELResolver.getValue(XelELResolver.java:71)
>> at

Any ideas??

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-06-04 08:45:32 +0800

davout gravatar image davout
1435 3 18

Please ignore! Just found the problem ... my getter method was incorrectly named.

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-06-04 08:42:55 +0800

Seen: 194 times

Last updated: Jun 04 '12

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