Suggested case list:
Using timer to refresh a grid
383guest172.69.33.12125nk0uiMay 7, 2020 7:23:47 AMlinkuser model to move item to another listbox
120guest162.158.193.148d0n3krApr 2, 2020 5:28:28 AMlinkDisabled list item row passed to VM-1981
296fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:44 PMlinkDisabled list item row passed to VM-1981
295fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:16 PMlinkDisabled list item row passed to VM-1981
294fatih123160.83.36.13225nk0uiFeb 13, 2018 3:30:44 PMlinkgrid sample with ListModel/RowRenderer
816guest80.82.2.1312vah9ajFeb 21, 2017 11:42:21 AMlinkgrid sample with ListModel/RowRenderer
809guest175.98.113.1622vah9ajJan 26, 2017 9:19:33 AMlinkgrid sample with ListModel/RowRenderer
196guest79.185.142.402vah9ajApr 26, 2014 10:53:57 PMlinkgrid sample with ListModel/RowRenderer
195guest79.185.142.402vah9ajApr 26, 2014 10:53:54 PMlinkgrid sample with ListModel/RowRenderer
194guest79.185.142.402vah9ajApr 26, 2014 10:53:51 PMlinkgrid sample with ListModel/RowRenderer
193guest79.185.142.402vah9ajApr 26, 2014 10:53:48 PMlinkgrid sample with ListModel/RowRenderer
192guest79.185.142.402vah9ajApr 26, 2014 10:53:44 PMlinkgrid sample with ListModel/RowRenderer
191guest79.185.142.402vah9ajApr 26, 2014 10:53:40 PMlinkHierarchy table without using ZK PE/EE
1aaknai151.28.135.2131s871daJul 29, 2013 11:02:46 PMlinkgrid sample with ListModel/RowRenderer
128aaknai151.28.135.2132vah9ajJul 29, 2013 7:20:00 PMlinkuser model to move item to another listbox
1TonyQ114.25.109.94d0n3krApr 21, 2012 10:43:27 AMlinkUsing timer to refresh a grid
1TonyQ220.133.44.3725nk0uiFeb 17, 2012 3:17:34 AMlinkFire a event from child iframe
1TonyQ220.133.44.372eupjotFeb 3, 2012 5:04:52 AMlinkTextbox input restriction sample
1TonyQ72.21.245.2431b3nlr0Dec 20, 2011 10:09:10 AMlinkTest web core taglib in ZUL
1TonyQ198.203.175.175ofqkemDec 17, 2011 3:36:08 AMlinkLatest 10 Fiddles :
Object hashcode different with ZK form binding
2YannUnil172.69.108.13540rj0kApr 19, 2024 1:18:08 PMlinkObject hashcode different with ZK form binding
1YannUnil172.69.108.13040rj0kApr 19, 2024 1:04:31 PMlinkfont awesome effects
1guest172.71.166.21232nla3hApr 18, 2024 6:04:43 PMlinkfont awesome effects
245guest172.71.166.21220t2jmoApr 18, 2024 6:04:41 PMlinkZK-5696
1JamesChu162.158.187.3739iuvhmApr 18, 2024 10:33:52 AMlinkListbox colspan header version 2
3guest172.71.183.199jkpp6qApr 17, 2024 1:54:19 PMlinkZK-5695
1guest162.158.90.1402is2rctApr 17, 2024 10:23:20 AMlinkLocalDate in datebox
2guest172.70.243.516v49n7Apr 17, 2024 6:05:17 AMlinkLocalDate in datebox
1guest172.70.243.516v49n7Apr 17, 2024 6:04:18 AMlinkLocalDate in datebox
1guest172.70.243.511m6i0gcApr 17, 2024 6:04:04 AMlinkProblem Upgrade to Zk8
38hawk59.127.29.1166s7pukMar 8, 2019 4:37:51 AMlinkresources
index.zulzul<zk xmlns:w="client" xmlns:ca="client/attribute">
<window title="user initialized form" border="normal" viewModel="@id('vm') @init('pkg$.TestFormVM')" validationMessages="@id('vmsgs')">
<include src="@load(vm.createPanel?'create.zul':'grid.zul')"/>
</window>
</zk>
TestFormVM.javajavaimport org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.util.Clients;
import org.zkoss.bind.annotation.NotifyChange;
import java.util.ArrayList;
import java.util.List;
import java.util.HashMap;
import java.util.Map;
public class TestFormVM {
private Pojo selectedPojo;
private List<Pojo> datos;
private boolean createPanel = false;
@Init
public void init() {
datos = new PojoData().getAllData();
}
public TestFormVM() {
datos = new ArrayList<Pojo>();
//selectedPojo = new Pojo();
selectedPojo = null;
}
@Command
@NotifyChange({ "datos", "selectedPojo", "createPanel" })
public void newRegister() {
Pojo p = new Pojo();
selectedPojo = p;
setCreatePanel(true);
}
@Command
@NotifyChange({ "datos", "selectedPojo" })
public void find() {
//datos.clear();
List<Pojo> lista = getDatos();
Clients.log("Lista: " + lista.size());
if (lista != null && lista.size() > 0)
setDatos(lista);
}
@Command
@NotifyChange({"datos","selectedPojo", "createPanel"})
public void save() {
//Map args = new HashMap();
//args.put("pCustomer", this.selectedPojo);
datos.add(selectedPojo);
createPanel = false;
}
@Command
@NotifyChange({ "createPanel", "selectedPojo" })
public void cancel() {
selectedPojo = null;
createPanel = false;
}
@NotifyChange("selectedPojo")
public void setSelectedPojo(Pojo selectedPojo) {
this.selectedPojo = selectedPojo;
}
public Pojo getSelectedPojo() {
return selectedPojo;
}
public List<Pojo> getDatos() {
return datos;
}
public void setDatos(List<Pojo> datos) {
this.datos = datos;
}
public void setCreatePanel(boolean createPanel) {
this.createPanel = createPanel;
}
public boolean getCreatePanel() {
return createPanel;
}
}
Pojo.javajavapublic class Pojo {
private String name;
private int age;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}grid.zulzul<zk>
<vlayout style="background-color:#dfdfdf;">
<button label="Find" onClick="@command('find')"/>
<button label="Create" onClick="@command('newRegister')"/>
<listbox autopaging="true" mold="paging"
style="border: 2px solid #d4d4d4;border-radius:6px" width="100%"
rows="10" model="@load(vm.datos)"
emptyMessage="No hay resultados para la búsqueda"
selectedItem="@bind(vm.selectedPojo)">
<custom-attributes org.zkoss.zul.listbox.rod="true" />
<auxhead>
<auxheader align="center" colspan="2">
<label value="Pojo Data"
style="font-weight: bold" />
</auxheader>
</auxhead>
<listhead sizable="true">
<listheader label="Name" align="left" />
<listheader label="Age" align="right" />
</listhead>
<template name="model">
<listitem>
<listcell label="@load(each.name)" />
<listcell label="@load(each.age)" />
</listitem>
</template>
</listbox>
</vlayout>
</zk>
create.zulzul<zk>
<vlayout style="background-color:#dfdfdf;">
<div align="center" height="100%"
form="@id('sel') @load(vm.selectedPojo) @save(vm.selectedPojo, before='save')">
<grid id="errorGrid" model="@bind(vmsgs.texts)"
visible="@bind(not empty vmsgs.texts)" hflex="min">
<template name="model" var="msg">
<row
style="background-color: #dfdfdf; border:none;">
<label value="@bind(msg)" sclass="error" />
</row>
</template>
</grid>
<!-- Panel de alta o modif -->
<grid width="80%" span="true"
sizedByContent="true">
<!-- -->
<auxhead>
<auxheader label="Create Pojo"
align="center" colspan="2"
style=" font-size: 15px; color: #ededed;" />
</auxhead>
<columns visible="false">
<column hflex="min" />
<column hflex="min" />
</columns>
<rows>
<row>
<cell colspan="1" align="right">
Name(*):
</cell>
<cell colspan="1" align="left">
<textbox id="name" cols="30"
value="@bind(sel.name)" maxlength="30"/>
</cell>
</row>
<row>
<cell colspan="1" align="right">
Age(*):
</cell>
<cell colspan="1" align="left">
<intbox id="age" cols="20"
value="@bind(sel.age)" maxlength="6"/>
</cell>
</row>
</rows>
</grid>
<hlayout>
<button id="cmdSave" label="Save" width="120px" mold="trendy"
height="30px" onClick="@command('save')">
</button>
<button id="cmdCancel" label="Cancel" width="120px" mold="trendy"
height="30px" onClick="@command('cancel')">
</button>
</hlayout>
</div>
</vlayout>
</zk>
PojoData.javajavaimport java.util.ArrayList;
import java.util.List;
public class PojoData {
public List<Pojo> getAllData() {
List<Pojo> alldata = new ArrayList<Pojo>();
Pojo d1 = new Pojo();
d1.setName("John");
d1.setAge(10);
alldata.add(d1);
d1 = new Pojo();
d1.setName("James");
d1.setAge(10);
alldata.add(d1);
d1 = new Pojo();
d1.setName("Smith");
d1.setAge(20);
alldata.add(d1);
d1 = new Pojo();
d1.setName("Anderson");
d1.setAge(30);
alldata.add(d1);
d1 = new Pojo();
d1.setName("Lee");
d1.setAge(40);
alldata.add(d1);
return alldata;
}
}