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 :

constraint binding textbox

3guest172.68.151.16220peldaDec 5, 2025 5:08:19 PMlink

Another new ZK fiddle

2guest172.68.151.16320peldaDec 5, 2025 5:07:51 PMlink

Another new ZK fiddle

1guest172.68.151.16220peldaDec 5, 2025 5:07:32 PMlink

Another new ZK fiddle

1peggypeng172.71.154.99364f4neDec 5, 2025 9:24:31 AMlink

tooltip example

2guest104.22.23.13rc1ntoDec 4, 2025 2:23:45 PMlink

Another new ZK fiddle

1guest172.69.134.2277t7602Dec 4, 2025 1:40:46 PMlink

Another new ZK fiddle

1peggypeng104.22.17.1802df6e3oDec 4, 2025 8:41:29 AMlink

onClose

1peggypeng172.68.87.248j8kd8aDec 3, 2025 4:10:26 AMlink

Another new ZK fiddle

1peggypeng172.69.134.2271rm7f4eNov 26, 2025 3:31:24 AMlink

ZK-5912-Suggestion

2rebeccalai104.22.20.1442qrmiiuNov 26, 2025 2:07:15 AMlink

ZK Form Sample with Bandbox

7hawk162.158.118.1782n2eevaOct 12, 2020 1:42:55 AMlink

resources

index.zulzul<zk xmlns:ca="client/attribute"> <window border="normal" title="hello" sizable="true" mode="modal" contentStyle="overflow: scroll;" height="500px" ca:data-scrollable="true"> <div apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('pkg$.FormViewModel')" validationMessages="@id('vmsgs')" form="@id('fx') @load(vm.user) @save(vm.user, before='submit') @validator('demo.input.form_sample.FormValidator', retypedPassword=vm.retypedPassword, captcha=vm.captcha, captchaInput=vm.captchaInput)"> <grid > <columns> <column label="Type" width="120px" /> <column label="Content" /> <column label="Component" width="200px" /> </columns> <rows> <row> <label value="UserName" width="150px" /> <hlayout> <textbox value="@bind(fx.userName)" width="150px" tabindex="1" /> </hlayout> <div> <label sclass="hightlight">Textbox</label> </div> </row> <row> Bandbox <bandbox value="@bind(fx.userName)" width="150px" > <bandpopup width="150px"> <listbox multiple="true" checkmark="true" fixedLayout="true" width="150px"> <listhead> <listheader label="g1"></listheader> </listhead> <listitem label="1"></listitem> <listitem label="11"></listitem> <listitem label="111"></listitem> </listbox> <listbox multiple="true" checkmark="true" fixedLayout="true" width="150px"> <listhead> <listheader label="g2"></listheader> </listhead> <listitem label="2"></listitem> <listitem label="22"></listitem> <listitem label="222"></listitem> </listbox> </bandpopup> </bandbox> </row> <row> Password <textbox type="password" value="@bind(fx.password)" width="150px" tabindex="2" /> <div> <label sclass="hightlight">Textbox</label> type = "password" </div> </row> <row> Re-type Password <cell> <textbox type="password" value="@bind(vm.retypedPassword)" width="150px" tabindex="3" /> <label class="error" value="@load(vmsgs['password'])" /> </cell> <div> <label sclass="hightlight">Textbox</label> with value validate </div> </row> <row> Age: <cell> <intbox value="@bind(fx.age)" width="150px" tabindex="4" /> <label class="error" value="@load(vmsgs['age'])" /> </cell> <div> <label sclass="hightlight">Intbox</label> with constraint </div> </row> <row> Phone: <textbox constraint="no empty" value="@bind(fx.telephone)" width="150px" maxlength="15" tabindex="5" /> <div> <label sclass="hightlight">Textbox</label> with max length limit </div> </row> <row> Weight: <cell> <decimalbox format="###.##" value="@bind(fx.weight)" width="150px" tabindex="6" /> <label class="error" value="@load(vmsgs['weight'])" /> </cell> <div> <label sclass="hightlight">Decimalbox</label> with format </div> </row> <row> Birthday: <hbox align="center"> <datebox value="@bind(fx.birthday)" format="@load(vm.dateFormat)" width="150px" tabindex="7"/> Format : <listbox selectedItem="@bind(vm.dateFormat)" mold="select" tabindex="8"> <listitem label="Default" value="" /> <listitem label="yyyy/MM/dd hh:mm a" value="yyyy/MM/dd hh:mm a" /> <listitem label="yyyy/MM/dd" value="yyyy/MM/dd" /> <listitem label="MM-dd-yy" value="MM-dd-yy" /> </listbox> </hbox> <div> <label sclass="hightlight">Datebox</label> and <label sclass="hightlight">Listbox</label> in select mold </div> </row> <row> E-mail: <cell> <textbox value="@bind(fx.email)" width="150px" tabindex="9" /> <label class="error" value="@load(vmsgs['email'])" /> </cell> <div> <label sclass="hightlight">Textbox</label> with regexp constraint </div> </row> <row> Memo: <vlayout> <div style="width:375px;text-align:right;padding:0;"> Adjust Height: <spinner constraint="no negative,no zero" value="@load(vm.memoHeight)" onChanging="@command('changeMemoHeight')" tabindex="10" /> </div> <textbox rows="@load(vm.memoHeight)" value="@bind(fx.memo)" width="370px;" tabindex="11" /> </vlayout> <div> <label sclass="hightlight">Textbox</label> with multiple rows and <label sclass="hightlight">Spinner</label> </div> </row> <row> Validation: <vlayout> <hlayout> <textbox value="@bind(vm.captchaInput)" width="150px" tabindex="12" /> <label class="error" value="@load(vmsgs['captcha'])" /> </hlayout> <hlayout> <captcha value="@load(vm.captcha)" bgColor="@load(vm.backgroundColour)" fontColor="@load(vm.foregroundColour)" width="150px" height="50px" frame="true" /> <vlayout> <button label="Regenerate" onClick="@command('regenerate')" width="100px" /> <hlayout> <colorbox value="@bind(vm.backgroundColour)" width="35px" /> <colorbox value="@bind(vm.foregroundColour)" width="35px" /> </hlayout> </vlayout> </hlayout> </vlayout> <div> <label sclass="hightlight">Captcha</label> and <label sclass="hightlight">Colorbox</label> </div> </row> <row> <cell colspan="3" style="text-align:center"> <vlayout> <label visible="@load(empty vmsgs)" value="@load(empty vmsgs ? 'Form successfully submitted!' : '', before='submit')" /> <button label="Submit" onClick="@command('submit')" width="100px" height="30px" /> </vlayout> </cell> </row> </rows> </grid> </div> </window> </zk> FormViewModel.javajavaimport org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.ContextParam; import org.zkoss.bind.annotation.ContextType; import org.zkoss.bind.annotation.NotifyChange; import org.zkoss.zk.ui.event.InputEvent; public class FormViewModel { private String dateFormat; private int memoHeight = 6; private String foregroundColour = "#000000", backgroundColour = "#FDC966"; private RandomStringGenerator rsg = new RandomStringGenerator(4); private User user = new User(); private String retypedPassword; private String captcha = rsg.getRandomString(), captchaInput; public String getForegroundColour() { return foregroundColour; } public void setForegroundColour(String foregroundColor) { this.foregroundColour = foregroundColor; } public String getBackgroundColour() { return backgroundColour; } public void setBackgroundColour(String backgroundColor) { this.backgroundColour = backgroundColor; } public String getDateFormat() { return dateFormat; } public void setDateFormat(String dateFormat) { this.dateFormat = dateFormat; } public int getMemoHeight() { return memoHeight; } public void setMemoHeight(int memoHeight) { this.memoHeight = memoHeight; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public String getRetypedPassword() { return retypedPassword; } public void setRetypedPassword(String retypedPassword) { this.retypedPassword = retypedPassword; } public String getCaptcha() { return captcha; } public void setCaptcha(String captcha) { this.captcha = captcha; } public String getCaptchaInput() { return captchaInput; } public void setCaptchaInput(String captchaInput) { this.captchaInput = captchaInput; } public void regenerateCaptcha() { this.captcha = rsg.getRandomString(); } @Command @NotifyChange("memoHeight") public void changeMemoHeight( @ContextParam(ContextType.TRIGGER_EVENT) InputEvent change) { try { int parsed = Integer.parseInt(change.getValue()); if (parsed > 0) { this.memoHeight = parsed; } } catch (NumberFormatException nfe) { // nothing that we can do here, the validation should pick it up } } @Command @NotifyChange("captcha") public void regenerate() { this.regenerateCaptcha(); } @Command public void submit() { } } RandomStringGenerator.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.util.Random; public class RandomStringGenerator { private int length; private String alphabet = "abcdefghijklmnopqrstuvwxyz"; private final Random rn = new Random(); public RandomStringGenerator(int length) { if(length <= 0) throw new IllegalArgumentException("Length cannot be less than or equal to 0"); this.length = length; } public int getLength() { return length; } public void setLength(int length) { this.length = length; } public String getRandomString() { StringBuilder sb = new StringBuilder(this.length); for(int i=0; i<this.length; i++) { sb.append(alphabet.charAt(rn.nextInt(alphabet.length()))); } return sb.toString(); } } User.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.util.Date; public class User { private String userName, password, telephone, email, memo; private int age; private double weight; private Date birthday; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getTelephone() { return telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getMemo() { return memo; } public void setMemo(String memo) { this.memo = memo; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public double getWeight() { return weight; } public void setWeight(double weight) { this.weight = weight; } public Date getBirthday() { return birthday; } public void setBirthday(Date birthday) { this.birthday = birthday; } } FormValidator.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.util.Map; import org.zkoss.bind.Property; import org.zkoss.bind.ValidationContext; import org.zkoss.bind.validator.AbstractValidator; public class FormValidator extends AbstractValidator { public void validate(ValidationContext ctx) { //all the bean properties Map<String,Property> beanProps = ctx.getProperties(ctx.getProperty().getBase()); //first let's check the passwords match validatePasswords(ctx, (String)beanProps.get("password").getValue(), (String)ctx.getValidatorArg("retypedPassword")); validateAge(ctx, (Integer)beanProps.get("age").getValue()); validateWeight(ctx, (Double)beanProps.get("weight").getValue()); validateEmail(ctx, (String)beanProps.get("email").getValue()); validateCaptcha(ctx, (String)ctx.getValidatorArg("captcha"), (String)ctx.getValidatorArg("captchaInput")); } private void validatePasswords(ValidationContext ctx, String password, String retype) { if(password == null || retype == null || (!password.equals(retype))) { this.addInvalidMessage(ctx, "password", "Your passwords do not match!"); } } private void validateAge(ValidationContext ctx, int age) { if(age <= 0) { this.addInvalidMessage(ctx, "age", "Your age should be > 0!"); } } private void validateWeight(ValidationContext ctx, double weight) { if(weight <= 0) { this.addInvalidMessage(ctx, "weight", "Your weight should be > 0!"); } } private void validateEmail(ValidationContext ctx, String email) { if(email == null || !email.matches(".+@.+\\.[a-z]+")) { this.addInvalidMessage(ctx, "email", "Please enter a valid email!"); } } private void validateCaptcha(ValidationContext ctx, String captcha, String captchaInput) { if(captchaInput == null || !captcha.equals(captchaInput)) { this.addInvalidMessage(ctx, "captcha", "The captcha doesn't match!"); } } }