vicky
vicky

Reputation: 940

zk: combobox model binding issue

I have a model which i have attached to combobox, in browser I can see the labels as name of kpis. problem is when I get the model after save, everything is there but this combobox value for kpiFrequency.kpi or kpiDTO value in kpiFrequency. I want any of the object filled with selected kpifrequency along with associated kpi object.

here is my code: .zul file

    <combobox id="kpiCombobox" model="@load(kf.kpiList)" readonly="true" maxlength="40" width="80%" 
                                                     onChange="@command('onChnageKpiHeaderLabel')" selectedItem="@bind(kf.kpiFrequency.kpi.kpiName)">
                                                      <template name="model" var="kpiDTO">
                                                        <comboitem label="@load(kpiDTO.kpi.kpiName)" />
                                                     </template>
                                                </combobox>

my DTO snap,

public class KpiFrequencyDTO  {

    private KPIFrequency kpiFrequency;
    private List<KPIFrequency> kpiFrequencyList;
    private List<String> frequencyNameList;
    private List<String> typeList;
    private List<String> aggFormulaList;
    private List<KpiDTO> kpiList;
    private KpiDTO kpiDTO;

ANSWER

I am adding the answer which worked for me. in combobox, rather then using selectedItem, use value, it solves the problem i was faceing.

Upvotes: 0

Views: 2161

Answers (1)

user2309806
user2309806

Reputation:

See Zk Combobox With Selectoption

You will get the logic behind the ZK Combobox and how you have to made changes in your code .

Upvotes: 3

Related Questions