Processing...

Suggested case list:

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

identify firefox or not in server side

1TonyQ198.203.175.1751nv2qreDec 10, 2011 4:25:04 AMlink

ZK addThis integration

1TonyQ198.203.175.1751apl96jNov 5, 2011 4:12:50 AMlink

Latest 10 Fiddles :

Select from Radiogroup render template by controller

190guest159.224.7.123qn7fusFeb 22, 2019 1:15:33 PMlink

Dynamic Listbox Columns

113guest125.17.240.2311rhr8cdFeb 22, 2019 9:51:40 AMlink

ZK7 Monthbox Yearbox

12guest23.239.96.42ld4v50Feb 22, 2019 8:51:54 AMlink

listbox/frozen/auxheader

7guest125.227.72.313gt80tFeb 22, 2019 8:30:17 AMlink

Another new ZK fiddle

9guest119.130.171.21713vt3p3Feb 22, 2019 5:57:30 AMlink

Another new ZK fiddle

8guest119.130.171.21713vt3p3Feb 22, 2019 5:55:07 AMlink

Another new ZK fiddle

7guest119.130.171.21713vt3p3Feb 22, 2019 5:53:50 AMlink

Another new ZK fiddle

6guest119.130.171.21713vt3p3Feb 22, 2019 5:53:16 AMlink

Another new ZK fiddle

5guest119.130.171.21713vt3p3Feb 22, 2019 5:50:15 AMlink

Another new ZK fiddle

4guest119.130.171.21713vt3p3Feb 22, 2019 5:49:42 AMlink

SimpleGroupsModel with selectable ListItems

4guest116.12.139.99317884Feb 11, 2019 8:50:22 AMlink

resources

index.zulzul<zk> <window border="normal" title="hello" apply="pkg$.MainController"> <listbox id="lbCustomList" checkmark="false" multiple="false" width="100%" itemRenderer="pkg$.CustomListRenderer" use="pkg$.CustomListBox"> </listbox> <div width="100%" align="right"> <button id="btnEditCustomList" iconSclass="z-icon-cog" /> </div> </window> </zk> CustomListRenderer.javajavaimport org.zkoss.util.resource.Labels; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zkmax.zul.Rowchildren; import org.zkoss.zkmax.zul.Rowlayout; import org.zkoss.zul.A; import org.zkoss.zul.Div; import org.zkoss.zul.GroupsModel; import org.zkoss.zul.Html; import org.zkoss.zul.Image; import org.zkoss.zul.Label; import org.zkoss.zul.Listbox; import org.zkoss.zul.Listcell; import org.zkoss.zul.Listgroup; import org.zkoss.zul.Listitem; import org.zkoss.zul.ListitemRenderer; import org.zkoss.zul.Separator; public class CustomListRenderer implements ListitemRenderer<Object> { @Override public void render(final Listitem item, final Object obj, final int index) throws Exception { if (item instanceof Listgroup) { final String groupHead = (String)obj; item.appendChild(new Listcell(groupHead)); } else { final String displayName = (String)obj; final Listcell taskName = new Listcell(); taskName.setParent(item); // if (displayName.contains("(not selectable)")) { // determines if this item is selectable when whole listbox is in edit mode -> has to be false // item.setSelectable(false); // } taskName.setLabel(displayName); } } } CustomListModel.javajavaimport java.util.Arrays; import java.util.LinkedList; import java.util.List; import org.zkoss.util.resource.Labels; import org.zkoss.zk.ui.Sessions; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventQueue; import org.zkoss.zk.ui.event.EventQueues; import org.zkoss.zul.Messagebox; import org.zkoss.zul.SimpleGroupsModel; public class CustomListModel extends SimpleGroupsModel<String, String, String, String> { /** serial */ private static final long serialVersionUID = 1L; /** Constant group header */ private static final String[] GROUP_HEADS = {"group1", "group2", "group3", "group4"}; private static final List<String> GROUP_HEAD_LIST = Arrays.asList(GROUP_HEADS); /** * Constructor */ public CustomListModel() { super(getDummyData(), GROUP_HEAD_LIST); } /** * Synchronize the data from the bakcend */ private static List<List<String>> getDummyData() { final List<List<String>> orderedContent = new LinkedList<>(); // prepare sub lists GROUP_HEAD_LIST.forEach(item -> orderedContent.add(new LinkedList<>())); orderedContent.get(0).add("test in group1 (not selectable)"); orderedContent.get(1).add("test in group2 (not selectable)"); orderedContent.get(2).add("test in group3 (not selectable)"); orderedContent.get(3).add("test in group4"); return orderedContent; } } MainController.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.ui.select.*; import org.zkoss.zk.ui.select.annotation.*; import org.zkoss.zk.au.*; import org.zkoss.zk.au.out.*; import org.zkoss.zul.*; public class MainController extends SelectorComposer<Component> { @Wire("#btnEditCustomList") Button btnEditCustomList; @Wire("#lbCustomList") CustomListBox lbCustomList; private boolean display = false; public void doAfterCompose(Component comp) throws Exception { super.doAfterCompose(comp); } @Listen("onClick = button#btnEditCustomList") public void onEditCustomList() { if (this.lbCustomList != null && this.btnEditCustomList != null) { if (display) { // hide checkmarks for listbox this.lbCustomList.setCheckmark(false); this.lbCustomList.setMultiple(false); this.display=false; } else { // show checkmars for each listbox element this.lbCustomList.setCheckmark(true); this.lbCustomList.setMultiple(true); this.display=true; } } } } CustomListBox.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 CustomListBox extends Listbox { public CustomListBox(){ super(); CustomListModel customListModel = new CustomListModel(); customListModel.setSelectionControl(new CustomSelectionControl(customListModel)); setModel(customListModel); } } CustomSelectionControl.javajava import java.lang.ref.WeakReference; import org.zkoss.zul.SimpleGroupsModel; import org.zkoss.zul.ext.SelectionControl; public class CustomSelectionControl implements SelectionControl<String> { WeakReference<SimpleGroupsModel> model; public CustomSelectionControl(SimpleGroupsModel model) { this.model = new WeakReference<SimpleGroupsModel>(model); } @Override public void setSelectAll(boolean selectAll) { //implement your own selectAll if you want to use this feature } @Override public boolean isSelectAll() { //implement your own selectAll if you want to use this feature return false; } @Override public boolean isSelectable(String e) { return !e.contains("(not selectable)"); } }