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 :
Another new ZK fiddle
31guest172.70.131.691mlke7fOct 3, 2023 6:27:23 PMlinkAnother new ZK fiddle
30guest172.70.178.1641mlke7fOct 3, 2023 6:26:11 PMlinkAnother new ZK fiddle
29guest172.70.178.1641mlke7fOct 3, 2023 6:26:09 PMlinkAnother new ZK fiddle
28guest172.70.100.1751mlke7fOct 3, 2023 6:24:37 PMlinkAnother new ZK fiddle
27guest108.162.216.1141mlke7fOct 3, 2023 6:13:35 PMlinkAnother new ZK fiddle
26guest172.70.179.1001mlke7fOct 3, 2023 6:08:44 PMlinkAnother new ZK fiddle
25guest172.70.179.991mlke7fOct 3, 2023 6:08:32 PMlinkAnother new ZK fiddle
24guest172.70.179.1001mlke7fOct 3, 2023 6:07:56 PMlinkAnother new ZK fiddle
23guest172.69.59.721mlke7fOct 3, 2023 6:06:42 PMlinkAnother new ZK fiddle
22guest172.70.178.1521mlke7fOct 3, 2023 6:04:10 PMlinkB30-1823207
1JamesChu162.158.91.272ffbcatSep 19, 2023 4:08:22 AMlinkresources
index.zulzul<?xml version="1.0" encoding="UTF-8"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
<zk>
<html><![CDATA[
1. Select randomly an item from the 1st listbox.<br/>
2. The selected item should appear in the 2nd listbox.<br/>
3. Repeat 1 and 2 in RANDOM order, the 2nd listbox should list items in order no matter the added sequence.<br/>
4. Press the parentModel button and check the real order of the 2nd listbox. It should be in order.<br/>
5. Press the parents button and check the real order of the inner TreeMap. It should be in order.<br/>
6. If everything ok. Now start to check "remove" item from 2nd listbox.<br/>
7. DoubleClick randomly on the item of the 2nd listbox and check if it is removed properly and kept the order.<br/>
8. Now repeate 4 and 5 to see if the inner data structure is in the same order as shown on the 2nd listbox.<br/>
]]></html>
<window closable="true" id="testArticoloWind"
width="200px" title="Test"
xmlns="http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd ">
<zscript><![CDATA[
public class BlahComparator implements Comparator {
public int compare(Object o1, Object o2) {
int p1 = ((Blah)o1).getNumber();
int p2 = ((Blah)o2).getNumber();
int res = 0;
if(p1 > p2) res = 1;
else if(p1 < p2) res = -1;
return res;
}
}
class Person {
TreeMap parents = new TreeMap(new BlahComparator());
public TreeMap getParents(){
return parents;
}
public void addParent(Object o){
parents.put(o, new Integer(o.getAge()));
}
}
class Blah implements Comparable{
int age = 10;
int number = 0;
private String name ;
private static int counter = 1;
public Blah(int age){
name = "Blah " + Integer.toString((number = counter++));
this.age = age;
}
public void setName(String n){
name = n;
}
public String getName(){
return name;
}
public String toString(){
return name;
}
public int getNumber(){
return number;
}
public int getAge() {
return age;
}
public int compareTo(Object o){
int n = ((Blah)o).getNumber();
if(number > n) return 1;
if(number < n) return -1;
return 0;
}
}
Person person = new Person();
int actionCounter = 1;
ArrayList l = new ArrayList(20);
java.util.Random rand = new java.util.Random();
for(int i = 0; i < 20; i++)
l.add(new Blah(rand.nextInt(50)+1));
]]></zscript>
<groupbox>
<caption label="1st listbox"/>
<listbox model="@{l}" mold="select" >
<attribute name="onSelect">
Blah p = l.get(self.selectedIndex);
((Map)parentsList.getModel()).put(p, new Integer(p.getAge()));
</attribute>
</listbox>
</groupbox>
<groupbox>
<caption label="2nd listbox"/>
<listbox id="parentsList" model="@{person.parents}">
<listhead>
<listheader label="Name"/>
<listheader label="Age"/>
</listhead>
<listitem self="@{each=obj}" value="@{obj}">
<attribute name="onDoubleClick">
((Map)parentsList.getModel()).remove(((java.util.Map.Entry)self.value).getKey());
</attribute>
<listcell label="@{obj.key}"/>
<listcell label="@{obj.value}"/>
</listitem>
</listbox>
</groupbox>
<button label="parentModel" onClick='alert(""+parentsList.getModel())'/>
<button label="parents" onClick='alert(""+person.getParents())'/>
<button label="Listitem.getItems()">
<attribute name="onClick"><![CDATA[
StringBuffer sb = new StringBuffer(124);
for(Iterator it = parentsList.getItems().iterator(); it.hasNext();) {
Listitem li = (Listitem) it.next();
sb.append(li.getValue()+",");
}
alert(sb.toString());
]]></attribute>
</button>
</window>
</zk>