Revision history [back]

click to hide/show revision 1
initial version

asked 2012-08-22 07:22:38 +0800

tisaksen gravatar image tisaksen

Change data in Combobox and setSelectedItem throws exception

I have the following code:

<combobox id="pfcCombo2" readonly="true" width="270px" <br=""> model="@load(pjvm.pfcList)" selectedItem="@bind(pjvm.selectedPfcItem)" onSelect="@command('onSelectPfcCombo')" disabled="@load(not pjvm.pfcComboEnabled)"> <template name="model" var="pfc"> <comboitem label="@load(pfc.pfc_desc)" value="@load(pfc.pfc_code)"></comboitem> </template> </combobox>

Works fine but when I try to change the content of the list:

PfcCode p = new PfcCode(); setPfcList(Arrays.asList(p)); setSelectedPfcItem(p); <-- throws exception:

SEVERE: >>org.zkoss.zk.ui.UiException: model of the databind combobox <combobox vcgmb0#pfccombo2=""> must be an instanceof of org.zkoss.zkplus.databind.B indingListModel.[PfcCode{pfccode=B10, pfcdesc=Radiator, marketcode=null, prodcatcode=null, servicetype_code=null}]

Why ? ?

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