-
FEATURED COMPONENTS
First time here? Check out the FAQ!
![]() | 1 | initial version | |
Hi,
I am new to ZK framework. I have two grids in same zul file. When ever i click on first grid row cell button then i need to populate other grid.
For this i have written viewmodel, when ever i click on button am calling viewmodel notifyChange event and written business logic to get details of list to populate other grid. But the list of object while accessing in zul file am not able to get value.
zul file
<window apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm') @init('com.hm.controller.CountryViewModel')">
<listbox vflex="true" hflex="1" model="@load(vm.countryData.countries)">
<auxhead>
<auxheader colspan="6" class="topic">Country List</auxheader>
</auxhead>
<listhead>
<listheader label="Country Name" align="center"/>
<listheader label="Country Code" align="center"/>
</listhead>
<template name="model" var="country">
<listitem>
<listcell>
<hbox>
<button label="@load(country.countryName)" onclick="@command('countryDetails', countryId=country.countryId)"/>
</hbox>
</listcell>
<listcell label="@load(country.code)"/>
</listitem>
</template>
</listbox>
@Command @NotifyChange("countryDetails") public List<state> countryDetails(@BindingParam("countryId") int countryId) { List<state> states = new CountryDaoImpl().getStates(countryId); return states; }
<grid model="${states}" emptymessage="Nothing in Domain" height="400px"> <columns sclass="tableDataHeading"> <column label="state Name" sclass="w10"/> <column label="code" sclass="w20"/> </columns> <template name="model" var="state"> <row> <label value="${state.stateName}"/> <label value="${state.code}"/> </row> </template> </grid>
Please suggest me on this.
Thanks, Sreedhar
![]() | 2 | No.2 Revision |
Hi,
I am new to ZK framework. I have two grids in same zul file. When ever i click on first grid row cell button then i need to populate other