-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I'm using validation with zk constraint when click on save button it trigger but it's doing save operation with null value.
I want to do when it's trigger, the save operation must be stop.
<intbox id="priority" value="@bind(vm.priority)" maxlength="3" constraint="no empty" ></intbox>
Hi all,
Another issue in zk.
zk allowing % in Intbox. but it should not allow this character in intbox.
please find demo code here.
you enter some garbage data inside date box and see validation.
how can i detect this validation in my java code when oncCick on save button.
validation.zul
<zk> <window width="100%" height="100%" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.test.Validation')"> <toolbar id="listToolbarProcess" sclass="vista" height="20px" align="start"> <toolbarbutton label="Save" onClick="@command('doSave')" ></toolbarbutton> </toolbar> <vlayout sclass="vertical-scroll" vflex="1"> <intbox id="priority" value="@bind(vm.value)" maxlength="3" constraint="no empty" ></intbox> <datebox value="@bind(vm.date)"></datebox> </vlayout> </window> </zk>
Validation.java
package com.test; import java.sql.Timestamp; import org.zkoss.bind.annotation.AfterCompose; import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.ContextParam; import org.zkoss.bind.annotation.ContextType; import org.zkoss.zk.ui.Component; public class Validation { /** * @author Himanshu */ Integer value; public Integer getValue() { return value; } public void setValue(Integer value) { this.value = value; } Timestamp date; public Timestamp getDate() { return date; } public void setDate(Timestamp date) { this.date = date; } @AfterCompose public void afterCompose(@ContextParam(ContextType.VIEW) Component view) { } @Command public void doSave() { System.out.println(" value =" + value); System.out.println(" Date Value =" + date); } }
Asked: 2013-01-17 12:45:16 +0800
Seen: 59 times
Last updated: Jan 17 '13