org.zkoss.zul
Interface Constraint

All Known Implementing Classes:
SimpleConstraint, SimpleDateConstraint, SimpleDoubleSpinnerConstraint, SimpleSpinnerConstraint

public interface Constraint

A constraint. Instead of implementing this interface, you may use 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.

Author:
tomyeh
See Also:
CustomConstraint, ClientConstraint

Method Summary
 void validate(Component comp, java.lang.Object value)
          Verifies whether the value is acceptable.
 

Method Detail

validate

void validate(Component comp,
              java.lang.Object value)
              throws WrongValueException
Verifies whether the value is acceptable.

Parameters:
comp - the component being validated
Throws:
WrongValueException


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo