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 :

ComboBox - Selection with Checkboxes

25guest162.158.187.7elaaadMar 29, 2024 7:57:07 AMlink

ComboBox - Selection with Checkboxes

24guest172.70.206.179elaaadMar 29, 2024 7:27:32 AMlink

check

244guest172.71.126.18620t2jmoMar 29, 2024 7:08:48 AMlink

frozen scroll

1guest172.69.33.373j82a06Mar 28, 2024 8:03:44 AMlink

Gmarker and forEach

1guest172.68.67.1362lpvk1hMar 28, 2024 7:29:50 AMlink

Gmaps

1guest172.68.67.1363dvghg5Mar 28, 2024 7:28:20 AMlink

grid demo

5guest172.71.158.2371grhhu3Mar 27, 2024 7:46:36 AMlink

grid demo

4guest172.71.158.2371grhhu3Mar 27, 2024 7:46:25 AMlink

grid demo

3guest172.71.154.181grhhu3Mar 27, 2024 7:44:16 AMlink

grid demo

2guest172.71.154.181grhhu3Mar 27, 2024 7:43:58 AMlink

Another new ZK fiddle

1guest172.70.210.1971maq2shJul 1, 2022 7:15:41 AMlink

resources

index.zulzul<zk xmlns:w="client"> <script><![CDATA[ zk.afterLoad("zul.inp", function () { zul.inp.TextboxSearch = zk.$extends(zul.inp.Textbox, { bind_: function() { var result = this.$supers('bind_', arguments); this.$n().type='search'; return result; } }); }); ]]></script> <div> <textbox/> <textbox w:use="zul.inp.TextboxSearch" onBlur="self.invalidate();" /> <textbox use="pkg$.TextboxSearch" type="search"/> </div> </zk>TextboxSearch.javajava/* Textbox.java Purpose: Description: History: Tue Jun 14 15:48:28 2005, Created by tomyeh Copyright (C) 2005 Potix Corporation. All Rights Reserved. {{IS_RIGHT This program is distributed under LGPL Version 2.1 in the hope that it will be useful, but WITHOUT ANY WARRANTY. }}IS_RIGHT */ import java.util.HashMap; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.UiException; import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.sys.BooleanPropertyAccess; import org.zkoss.zk.ui.sys.IntPropertyAccess; import org.zkoss.zk.ui.sys.PropertyAccess; import org.zkoss.zk.ui.sys.StringPropertyAccess; import org.zkoss.zul.impl.InputElement; /** * A textbox. * * <p>See <a href="package-summary.html">Specification</a>.</p> * <p>Default {@link #getZclass}: z-textbox.(since 3.5.0)</p> * <p>When multiline is true, only default mold is available.<p> * @author tomyeh */ public class TextboxSearch extends InputElement { private AuxInfo _auxinf; public TextboxSearch() { setValueDirectly(""); } public TextboxSearch(String value) throws WrongValueException { setValue(value); } /** Returns the value. * The same as {@link #getText}. * <p>Default: "". * @exception WrongValueException if user entered a wrong value */ public String getValue() throws WrongValueException { return getText(); } /** Sets the value. * * @param value the value; If null, it is considered as empty. * @exception WrongValueException if value is wrong */ public void setValue(String value) throws WrongValueException { setText(value); } //-- super --// /** Coerces the value passed to {@link #setValue}. * * <p>Default: convert null to an empty string. */ protected Object coerceFromString(String value) throws WrongValueException { return value != null ? value : ""; } /** Coerces the value passed to {@link #setValue}. * * <p>Default: convert null to an empty string. */ protected String coerceToString(Object value) { return value != null ? (String) value : ""; } /** Returns the type. * <p>Default: text. */ public String getType() { return _auxinf != null ? _auxinf.type : TEXT; } /** Sets the type. * @param type the type. Acceptable values are "text" and "password". * Unlike XUL, "timed" is redundant because it is enabled as long as * onChanging is added. Since 6.5.0 type also support tel, email and url. */ public void setType(String type) throws WrongValueException { if (!TEXT.equals(type) && !"password".equals(type) && !"tel".equals(type) && !"email".equals(type) && !"url".equals(type) && !"search".equals(type)) throw new WrongValueException("Illegal type: " + type); if (!type.equals(_auxinf != null ? _auxinf.type : TEXT)) { initAuxInfo().type = type; smartUpdate("type", getType()); } } /** Returns the rows. * <p>Default: 1. */ public int getRows() { return _auxinf != null ? _auxinf.rows : 1; } /** Sets the rows. * <p> * Note: Not allowed to set rows and height/vflex at the same time */ public void setRows(int rows) throws WrongValueException { checkBeforeSetRows(); if (rows <= 0) throw new WrongValueException("Illegal rows: " + rows); if ((_auxinf != null ? _auxinf.rows : 1) != rows) { initAuxInfo().rows = rows; if (rows > 1) setMultiline(true); //auto-enable smartUpdate("rows", getRows()); } } /** * Internal check if there is any use of vflex and height before setRows */ protected void checkBeforeSetRows() throws UiException { //ZK-4296: Error indicating incorrect usage when using both vflex and rows if (this.getVflex() != null) throw new UiException("Not allowed to set rows and vflex at the same time"); if (this.getHeight() != null) throw new UiException("Not allowed to set rows and height at the same time"); } /** Returns whether it is multiline. * <p>Default: false. */ public boolean isMultiline() { return _auxinf != null && _auxinf.multiline; } /** Sets whether it is multiline. */ public void setMultiline(boolean multiline) { if ((_auxinf != null && _auxinf.multiline) != multiline) { initAuxInfo().multiline = multiline; smartUpdate("multiline", isMultiline()); } } /** Returns whether TAB is allowed. * If true, the user can enter TAB in the textbox, rather than change * focus. * <p>Default: false. * @since 3.6.0 */ public boolean isTabbable() { return _auxinf != null && _auxinf.tabbable; } /** Sets whether TAB is allowed. * If true, the user can enter TAB in the textbox, rather than change * focus. * <p>Default: false. * @since 3.6.0 */ public void setTabbable(boolean tabbable) { if ((_auxinf != null && _auxinf.tabbable) != tabbable) { initAuxInfo().tabbable = tabbable; smartUpdate("tabbable", isTabbable()); } } /** Returns whether it is submitByEnter, * If submitByEnter is true, press enter will fire onOK event instead of move to next line, * you should press shift + enter if you want to move to next line. * <p>Default: false. * @return true if it is submitByEnter. * @since 8.5.2 */ public boolean isSubmitByEnter() { return _auxinf != null && _auxinf.submitByEnter; } /** Sets whether it is submitByEnter. * If submitByEnter is true, press enter will fire onOK event instead of move to next line, * you should press shift + enter if you want to move to next line. * @param submitByEnter whether it is submitByEnter * @since 8.5.2 */ public void setSubmitByEnter(boolean submitByEnter) { if ((_auxinf != null && _auxinf.submitByEnter) != submitByEnter) { initAuxInfo().submitByEnter = submitByEnter; smartUpdate("submitByEnter", isSubmitByEnter()); } } @Override public void setVflex(String flex) { //ZK-4296: Error indicating incorrect usage when using both vflex and rows if (this.getRows() != 1) throw new UiException("Not allowed to set vflex and rows at the same time"); super.setVflex(flex); } @Override public void setHeight(String height) { //ZK-4296: Error indicating incorrect usage when using both vflex and rows if (this.getRows() != 1) throw new UiException("Not allowed to set height and rows at the same time"); super.setHeight(height); } //Cloneable// public Object clone() { final TextboxSearch clone = (TextboxSearch) super.clone(); if (_auxinf != null) clone._auxinf = (AuxInfo) _auxinf.clone(); return clone; } //--ComponentCtrl--// private static HashMap<String, PropertyAccess> _properties = new HashMap<String, PropertyAccess>(5); static { _properties.put("value", new StringPropertyAccess() { public void setValue(Component cmp, String value) { ((TextboxSearch) cmp).setValue(value); } public String getValue(Component cmp) { return ((TextboxSearch) cmp).getValue(); } }); _properties.put("type", new StringPropertyAccess() { public void setValue(Component cmp, String value) { ((TextboxSearch) cmp).setType(value); } public String getValue(Component cmp) { return ((TextboxSearch) cmp).getType(); } }); _properties.put("tabbable", new BooleanPropertyAccess() { public void setValue(Component cmp, Boolean value) { ((TextboxSearch) cmp).setTabbable(value); } public Boolean getValue(Component cmp) { return ((TextboxSearch) cmp).isTabbable(); } }); _properties.put("rows", new IntPropertyAccess() { public void setValue(Component cmp, Integer value) { ((TextboxSearch) cmp).setRows(value); } public Integer getValue(Component cmp) { return ((TextboxSearch) cmp).getRows(); } }); _properties.put("multiline", new BooleanPropertyAccess() { public void setValue(Component cmp, Boolean multiline) { ((TextboxSearch) cmp).setMultiline(multiline); } public Boolean getValue(Component cmp) { return ((TextboxSearch) cmp).isMultiline(); } }); _properties.put("submitByEnter", new BooleanPropertyAccess() { public void setValue(Component cmp, Boolean submitByEnter) { ((TextboxSearch) cmp).setSubmitByEnter(submitByEnter); } public Boolean getValue(Component cmp) { return ((TextboxSearch) cmp).isSubmitByEnter(); } }); } public PropertyAccess getPropertyAccess(String prop) { PropertyAccess pa = _properties.get(prop); if (pa != null) return pa; return super.getPropertyAccess(prop); } //-- super --// protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException { super.renderProperties(renderer); render(renderer, "multiline", isMultiline()); final int rows = getRows(); if (rows > 1) renderer.render("rows", rows); render(renderer, "tabbable", isTabbable()); final String type = getType(); if (!TEXT.equals(type)) renderer.render("type", type); render(renderer, "submitByEnter", isSubmitByEnter()); } public String getZclass() { return _zclass != null ? _zclass : "z-textbox"; } private static final String TEXT = "text"; private AuxInfo initAuxInfo() { if (_auxinf == null) _auxinf = new AuxInfo(); return _auxinf; } private static class AuxInfo implements java.io.Serializable, Cloneable { private String type = TEXT; private int rows = 1; private boolean multiline; private boolean tabbable; private boolean submitByEnter; public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(); } } } }