Processing...

Suggested case list:

Using timer to refresh a grid

383guest172.69.33.12125nk0uiMay 7, 2020 7:23:47 AMlink

user model to move item to another listbox

120guest162.158.193.148d0n3krApr 2, 2020 5:28:28 AMlink

Disabled list item row passed to VM-1981

296fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:44 PMlink

Disabled list item row passed to VM-1981

295fatih123160.83.36.13025nk0uiFeb 13, 2018 4:25:16 PMlink

Disabled list item row passed to VM-1981

294fatih123160.83.36.13225nk0uiFeb 13, 2018 3:30:44 PMlink

grid sample with ListModel/RowRenderer

816guest80.82.2.1312vah9ajFeb 21, 2017 11:42:21 AMlink

grid sample with ListModel/RowRenderer

809guest175.98.113.1622vah9ajJan 26, 2017 9:19:33 AMlink

grid sample with ListModel/RowRenderer

196guest79.185.142.402vah9ajApr 26, 2014 10:53:57 PMlink

grid sample with ListModel/RowRenderer

195guest79.185.142.402vah9ajApr 26, 2014 10:53:54 PMlink

grid sample with ListModel/RowRenderer

194guest79.185.142.402vah9ajApr 26, 2014 10:53:51 PMlink

grid sample with ListModel/RowRenderer

193guest79.185.142.402vah9ajApr 26, 2014 10:53:48 PMlink

grid sample with ListModel/RowRenderer

192guest79.185.142.402vah9ajApr 26, 2014 10:53:44 PMlink

grid sample with ListModel/RowRenderer

191guest79.185.142.402vah9ajApr 26, 2014 10:53:40 PMlink

Hierarchy table without using ZK PE/EE

1aaknai151.28.135.2131s871daJul 29, 2013 11:02:46 PMlink

grid sample with ListModel/RowRenderer

128aaknai151.28.135.2132vah9ajJul 29, 2013 7:20:00 PMlink

user model to move item to another listbox

1TonyQ114.25.109.94d0n3krApr 21, 2012 10:43:27 AMlink

Using timer to refresh a grid

1TonyQ220.133.44.3725nk0uiFeb 17, 2012 3:17:34 AMlink

Fire a event from child iframe

1TonyQ220.133.44.372eupjotFeb 3, 2012 5:04:52 AMlink

Textbox input restriction sample

1TonyQ72.21.245.2431b3nlr0Dec 20, 2011 10:09:10 AMlink

Test web core taglib in ZUL

1TonyQ198.203.175.175ofqkemDec 17, 2011 3:36:08 AMlink

Latest 10 Fiddles :

Change background color selected item from listbox

55guest162.158.186.168144129uOct 23, 2020 10:55:59 PMlink

Another new ZK fiddle

1guest172.68.24.23616430hmOct 23, 2020 8:26:21 PMlink

Force validation of constraints before processing the form

8guest162.158.191.1881jijgm5Oct 23, 2020 7:25:02 PMlink

Count No of Char

6guest162.158.165.482c277irOct 23, 2020 6:16:23 PMlink

Count No of Char

5guest162.158.165.482c277irOct 23, 2020 6:13:35 PMlink

Count No of Char

4guest162.158.165.482c277irOct 23, 2020 6:13:12 PMlink

Count No of Char

3guest162.158.165.482c277irOct 23, 2020 6:12:23 PMlink

Tree selection

1guest172.69.55.112g0aodtOct 23, 2020 2:14:45 PMlink

Detached selection popup

1guest141.101.105.821n4cg10Oct 23, 2020 1:55:58 PMlink

image distortion issue

2guest172.69.34.2342jhdm5mOct 23, 2020 9:06:41 AMlink

HugeListModelSizeTest

4cor3000220.134.32.2423ebc7jbJan 11, 2018 7:16:25 AMlink

resources

index.zulzul<zk> <window border="normal" title="hello" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('pkg$.TestViewModel')"> <grid mold="paging" model="@bind(vm.items)" pageSize="@load(vm.pageSize)"> <custom-attributes org.zkoss.zul.grid.rod="false"/> <columns> <column label="ID"/> <column label="Name"/> </columns> <rows> <template name="model"> <row> <label value="@load(each.id)"/> <label value="@load(each.name)"/> </row> </template> </rows> </grid> getSize() invoke counter: <label value="@bind(vm.sizeCounter)"/> </window> </zk>TestViewModel.javajavaimport org.zkoss.bind.annotation.*; import org.zkoss.zhtml.Filedownload; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.select.Selectors; import org.zkoss.zk.ui.select.annotation.Wire; import org.zkoss.zul.AbstractListModel; import org.zkoss.zul.Combobox; import org.zkoss.zul.ListModel; import org.zkoss.zul.ListModelList; public class TestViewModel { private ListModel<TestItem> items; private int pageSize = 10; @AfterCompose @NotifyChange("sizeCounter") public void afterCompose(@ContextParam(ContextType.VIEW) final Component view) { Selectors.wireComponents(view, this, false); items = new TestListModel(pageSize); } public ListModel<TestItem> getItems() { return items; } public int getPageSize() { return pageSize; } public long getSizeCounter() { if(items != null) return ((TestListModel) items).getSizeCounter(); else return 0; } } TestListModel.javajavaimport org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; import java.io.*; import java.util.*; public class TestListModel extends AbstractListModel<TestItem> { private List<TestItem> testItems; private int pageSize; private final Map<Integer, TestItem> cache; private int size = -1; private long sizeCounter; public TestListModel(final int pageSize) { super(); generateItems(1000); this.pageSize = pageSize; this.cache = new HashMap<Integer, TestItem>(); } @Override public TestItem getElementAt(final int index) { TestItem testItem = cache.get(index); if (testItem == null) { try { final List<TestItem> testItems = getTestItems(index, pageSize); int indexKey = index; for (final TestItem o : testItems) { cache.put(indexKey, o); indexKey++; } } catch (final Exception e) { } finally { } } else { return testItem; } testItem = cache.get(index); if (testItem == null) { throw new RuntimeException("Element at index " + index + " cannot be found in the database."); } else { return testItem; } } @Override public int getSize() { sizeCounter++; if (size < 0) { try { size = (int) getFullItemsSize(); } catch (final Exception e) { } finally { } } return size; } private void generateItems(int size) { testItems = new ArrayList(size); Random rnd = new Random(); for(int i = 0; i < size; i++) { testItems.add(new TestItem(i, java.util.UUID.randomUUID().toString())); } } private List<TestItem> getTestItems(int index, int pageSize) { List<TestItem> chunk = new ArrayList<TestItem>(); int end; if((index + pageSize) > getFullItemsSize()) end = getFullItemsSize(); else end = index + pageSize; chunk = testItems.subList(index, end); return chunk; } private int getFullItemsSize() { return testItems.size(); } public long getSizeCounter() { return sizeCounter; } }TestItem.javajavaimport org.zkoss.zk.ui.*; import org.zkoss.zk.ui.event.*; import org.zkoss.zk.ui.util.*; import org.zkoss.zk.ui.ext.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; public class TestItem { private int id; private String name; public TestItem(int id, String name) { this.id = id; this.name = name; } public int getId() { return id; } public String getName() { return name; } }