<textbox
value="@load(vm.someAttribute) @save(vm.someAttribute, before='save')"
constraint="no empty" .../>
<button label="Submit" onClick="@command('save')"/>
Showing posts with label Validation. Show all posts
Showing posts with label Validation. Show all posts
Saturday, September 20, 2014
Validating Form When User Clicks Submit with ZK Framework
Monday, March 4, 2013
Zk form validation before button click.
Validation.zul
<zk xmlns:x="xhtml" xmlns:zk="zk">
<window width="100%"
height="100%"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('test.test.Validation')"
form="@id('fx') @load(vm) @save(vm,before='doSave')">
<vlayout sclass="vertical-scroll"
vflex="1">
<toolbar id="listToolbarProcess"
sclass="vista"
height="20px" align="start">
<toolbarbutton label="Save"
onClick="@command('doSave')" />
</toolbar>
<intbox id="priority"
maxlength="3" constraint="no empty"
value="@bind(fx.value)" />
<datebox value="@bind(fx.date)"></datebox>
</vlayout>
</window>
</zk>
Validation.java
package test.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
*/
@AfterCompose
public
void afterCompose(@ContextParam(ContextType.VIEW) Component view) {
}
@Command
public
void doSave() {
System.out.println("
value =" + str);
System.out.println("
Date Value =" + date);
}
boolean
check;
public
boolean isCheck() {
return
check;
}
public
void setCheck(boolean check) {
this.check
= check;
}
Integer
value;
public
Integer getValue() {
return
value;
}
public
void setValue(Integer value) {
this.value
= value;
}
String
str;
public
String getStr() {
return
str;
}
public
void setStr(String str) {
this.str
= str;
}
Timestamp
date;
public
Timestamp getDate() {
return
date;
}
public
void setDate(Timestamp date) {
this.date
= date;
}
}
Subscribe to:
Posts (Atom)
How ChatGPT can Benefit Coding: Your Guide to Leveraging an AI Language Model
Introduction: Hello, coders! Welcome to this blog post on how ChatGPT, an AI language model, can benefit your coding skills and projects. A...
-
It is a Fun Love calculator algorithm to find out love percentage. It is only for fun. You can check FLAMES Game . Here is Java...
-
index.jsp < HTML > < HEAD > < TITLE > Display file upload form to the user </ TITLE > </ HEAD > ...
-
Introduction: Hello, developers! Welcome to this blog post on how ChatGPT, an AI language model, can benefit your work and projects. Whethe...