|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClientSideValidator
This interface defines a validator that implements client side validation.
Method Summary | |
---|---|
java.lang.String |
generateClientSideValidation(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Generate client side validation, a snippet of browser JavaScript in a single line, creating an instance of a Validator object matching the format described in xspClientDojo.js, the attachValidator function. |
java.lang.String |
getInvalidMessage()
Unlike server-side validators which display different error messages depending on the exact way that validation fails, client side validators usually have only one error message. |
Method Detail |
---|
java.lang.String generateClientSideValidation(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
The file xspClientDojo.js is reference in the source of every XPage. The version with comments is installed with Designer under the Data/domino/js folder, in a file named xspClientDojo.js.uncompressed.js.
The constructor of the Validator object should be passed any values needed to perform the validation (e.g. for a range validator the minimum and maximum values would be included). The translated error message to display if the error occurs should be passed to the validator too. Generally the server-side validators translate a default error message and allow the page designer to override the default in a "message" property.
context
- The current context.component
- The control whose value will be validated, usually a
UIInput
.
java.io.IOException
java.lang.String getInvalidMessage()
This method may return different values depending on the configuration of the validator.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |