public interface CustomConstraint
Constraint
to denote
a constraint supports a custom way to display the error message.
If this interface is implemented, the default error box won't be
displayed. Rather, showCustomError(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.WrongValueException)
is called.
Since 5.0.0, CustomConstraint
has the higher priority than
ClientConstraint
. In other words, ClientConstraint
is ignored if both defined.
On the other hand, the client validation object (ClientConstraint.getClientConstraint()
)
can implement the showCustomError method to do the similar job
at the client.
Constraint
,
ClientConstraint
Modifier and Type | Method and Description |
---|---|
void |
showCustomError(Component comp,
WrongValueException ex)
To display the error message in a custom way.
|
void showCustomError(Component comp, WrongValueException ex)
comp
- the component causing the error.ex
- the error to display, or null to clear
the error message.Copyright © 2005-2011 Potix Corporation. All Rights Reserved.