-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I'm new in zk ,I have a form with field and I defined some constraint on those fields and a submit button ,who can I link the submit button with the form and fields ,so I want click on the button the fields where the constraint not satisfied will appear in red ,Now my button doesn't see if the constraint are satisfied ,I know that I could verify in java code but that will not make the fields.
Here is a nice example on zk fiddle of how you do it in MVVM.
You need to work with @load
and @save
seperated so you can tell to save before the command.
When your constraint fails the @command
is never fired.
<window apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('pkg$.VM')">
<hbox>
<textbox value="@load(vm.name) @save(vm.name,before='register')" constraint="no empty" />
<label value="@load(vm.name)" />
</hbox>
<hbox>
<button label="register" onClick="@command('register')" />
</hbox>
</window>
Asked: 2014-05-29 14:50:29 +0800
Seen: 36 times
Last updated: May 29 '14
Please help me in form binding
Where can I find a good template?
How close "father" window after creating "child" window
Notify Form of property change
How to handle lists and complex types with form?
ZK phone masking not working in IE11
Set Click in a textbox with zk
How to force Tabpanel to be renderer?