public interface Constraint
SimpleConstraint
if applicable.
To have better responsiveness, you can handle all (or some) validation
at the client by implementing an additional interface,
ClientConstraint
.
If you prefer to have a custom way to display
the error message (other than the default error box).
You can also implement CustomConstraint
.
Then, CustomConstraint.showCustomError(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.WrongValueException)
is called instead of
showing the default error box.
Since 5.0.0, ClientConstraint
takes higher priority
if both implemented.
CustomConstraint
,
ClientConstraint
Modifier and Type | Method and Description |
---|---|
void |
validate(org.zkoss.zk.ui.Component comp,
Object value)
Verifies whether the value is acceptable.
|
void validate(org.zkoss.zk.ui.Component comp, Object value) throws org.zkoss.zk.ui.WrongValueException
comp
- the component being validatedorg.zkoss.zk.ui.WrongValueException
Copyright © 2019. All rights reserved.