|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.validator.LongRangeValidator com.ibm.xsp.validator.LongRangeValidatorEx2
public class LongRangeValidatorEx2
Extends the standard long range validator to add support for automatic
client-side validation and computed expressions on it's properties.
Corresponds to the xp:validateLongRange
tag
Field Summary | |
---|---|
static java.lang.String |
VALIDATOR_ID
|
Fields inherited from class javax.faces.validator.LongRangeValidator |
---|
MAXIMUM_MESSAGE_ID, MINIMUM_MESSAGE_ID, TYPE_MESSAGE_ID |
Fields inherited from interface javax.faces.validator.Validator |
---|
NOT_IN_RANGE_MESSAGE_ID |
Constructor Summary | |
---|---|
LongRangeValidatorEx2()
|
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. |
javax.faces.component.UIComponent |
getComponent()
Return the associated UIComponent instance. |
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. |
long |
getMaximum()
|
java.lang.String |
getMessage()
Validation error message to be displayed to the user |
long |
getMinimum()
|
javax.faces.el.ValueBinding |
getValueBinding(java.lang.String property)
Return the ValueBinding instance to used to calculate the value for the specified property. |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
|
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
|
void |
setComponent(javax.faces.component.UIComponent component)
This will be called while constructing the component and the UIComponent tree, so no processing should be performed at this stage. |
void |
setMaximum(long maximum)
|
void |
setMessage(java.lang.String message)
Sets the validation error message to be displayed to the user |
void |
setMinimum(long minimum)
|
void |
setValueBinding(java.lang.String property,
javax.faces.el.ValueBinding binding)
Set the ValueBinding instance to used to calculate the value for the specified property. |
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component,
java.lang.Object value)
Perform the correctness checks implemented by this Validator against the specified UIInput . |
Methods inherited from class javax.faces.validator.LongRangeValidator |
---|
equals, isTransient, setTransient |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VALIDATOR_ID
Constructor Detail |
---|
public LongRangeValidatorEx2()
Method Detail |
---|
public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value) throws javax.faces.validator.ValidatorException
Perform the correctness checks implemented by this
Validator
against the specified UIInput
.
If any violations are found:
Message
s to the specified
FacesContext
, specifying this UIInput
as
associated with the message, describing the nature of the
violation(s) encountered.valid
property on the specified
UIInput
to false
.
validate
in interface javax.faces.validator.Validator
validate
in class javax.faces.validator.LongRangeValidator
context
- FacesContext for the request we are processingcomponent
- UIInput we are checking for correctnessvalue
- to be validated
java.lang.NullPointerException
- if context
or component
is null
javax.faces.FacesException
javax.faces.validator.ValidatorException
public void setComponent(javax.faces.component.UIComponent component)
ComponentBindingObject
setComponent
in interface ComponentBindingObject
public javax.faces.component.UIComponent getComponent()
ComponentBindingObject
getComponent
in interface ComponentBindingObject
public void setMaximum(long maximum)
setMaximum
in class javax.faces.validator.LongRangeValidator
public long getMaximum()
getMaximum
in class javax.faces.validator.LongRangeValidator
public void setMinimum(long minimum)
setMinimum
in class javax.faces.validator.LongRangeValidator
public long getMinimum()
getMinimum
in class javax.faces.validator.LongRangeValidator
public java.lang.String getMessage()
public java.lang.String getInvalidMessage()
ClientSideValidator
This method may return different values depending on the configuration of the validator.
getInvalidMessage
in interface ClientSideValidator
public void setMessage(java.lang.String message)
Set the value of the message
property.
public javax.faces.el.ValueBinding getValueBinding(java.lang.String property)
ValueBindingObject
getValueBinding
in interface ValueBindingObject
property
- Name of the property
public void setValueBinding(java.lang.String property, javax.faces.el.ValueBinding binding)
ValueBindingObject
setValueBinding
in interface ValueBindingObject
property
- Name of the propertybinding
- The ValueBinding to set, or null to remove an existing ValueBindingpublic java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class javax.faces.validator.LongRangeValidator
public void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class javax.faces.validator.LongRangeValidator
public java.lang.String generateClientSideValidation(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
ClientSideValidator
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.
generateClientSideValidation
in interface ClientSideValidator
context
- The current context.component
- The control whose value will be validated, usually a
UIInput
.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |