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