|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClientConstraint
Addition interface implemented with Constraint to denote
how to validate at the client.
Note: this interface is ignored if CustomConstraint
is also implemented, since CustomConstraint causes
all validations are processed at the server.
Constraint,
CustomConstraint| Method Summary | |
|---|---|
java.lang.String |
getClientValidation()
Returns the function name in JavaScript or a Javascript code snippet used to validate the value at the client, or null if no client verification is supported. |
java.lang.String |
getErrorMessage(Component comp)
Returns the error message when the client detects an error, or null if not specified. |
boolean |
isClientComplete()
Returns whether the client's validation is complete. |
| Method Detail |
|---|
java.lang.String getClientValidation()
There are two formats of the return value:
Format 1:
Syntax: function_name
Example: "zkVld.noEmpty"
What Really Happens:
zkVld.noEmpty('id') is called at the client side
to validate the input, where id is the component's identifier.
Format 2:
Syntax: function_name(arg1, arg2, arg3)
where arg could be #{EL_expression}
Example: "myValid(#{self},#{when},'more')"
What Really Happens:
myValid($e('id'),new Date('2007/06/03'),'more')
is called at the client side
to validate the input, where id is the component's identifier.
boolean isClientComplete()
getClientValidation()
return null or not.
java.lang.String getErrorMessage(Component comp)
It is used only if you want to override the default error message
shown by the client. It won't affect the message caused by an exception
thrown by Constraint.validate(org.zkoss.zk.ui.Component, java.lang.Object).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||