UIInput is a UIComponent that represents a component that both displays output to
the user (like UIOutput components do) and processes request
parameters on the subsequent request that need to be decoded. There
are no restrictions on the data type of the local value, or the
object referenced by the value binding expression (if any); however,
individual javax.faces.render.Renderers will generally impose
restrictions on the type of data they know how to display.
During the Apply Request Values phase
of the request processing lifecycle, the decoded value of this
component, usually but not necessarily a String, must be stored - but
not yet converted - using setSubmittedValue(). If the
component wishes to indicate that no particular value was submitted,
it can either do nothing, or set the submitted value to
null.
By default, during the Process Validators phase of the
request processing lifecycle, the submitted value will be converted
to a typesafe object, and, if validation succeeds, stored as a local
value using setValue(). However, if the
immediate property is set to true, this
processing will occur instead at the end of the Apply Request
Values phase.
During the Render Response phase of the request
processing lifecycle, conversion for output occurs as for UIOutput.
When the validate() method of this UIInput
detects that a value change has actually occurred, and that all
validations have been successfully passed, it will queue a ValueChangeEvent. Later on, the broadcast() method
will ensure that this event is broadcast to all interested listeners.
This event will be delivered by default in the Process
Validators phase, but can be delivered instead during Apply
Request Values if the immediate property is set to
true. If the validation
fails, the implementation must call FacesContext#validationFailed.
By default, the rendererType property must be set to
"Text". This value can be changed by calling the
setRendererType() method.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUE
If this param is set, and calling toLowerCase().equals("true") on a String representation of its value returns true, validation must be performed, even when there is no corresponding value for this component in the incoming request. |
| private static final String | |
| public static final String | COMPONENT_FAMILY
Hides javax. The standard component family for this component. |
| public static final String | COMPONENT_TYPE
Hides javax. The standard component type for this component. |
| public static final String | CONVERSION_MESSAGE_ID
The message identifier of the
|
| public static final String | EMPTY_STRING_AS_NULL_PARAM_NAME
The name of a context parameter that indicates how empty strings need to be interpreted. |
| private static final Validator | |
| private transient Boolean | |
| private transient Boolean | |
| public static final String | REQUIRED_MESSAGE_ID
The message identifier of the
|
| private transient Object | submittedValue
The submittedValue value of this |
| public static final String | UPDATE_MESSAGE_ID
The message identifier of the
|
| public static final String | VALIDATE_EMPTY_FIELDS_PARAM_NAME
The name of a context parameter that indicates how empty values should be handled with respect to validation. |
| private transient Boolean | |
| pack-priv AttachedObjectListHolder | validators
The set of |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | addValidator(Validator<T>
The validator)Validator to addImplements javax. Add a |
| public void | addValueChangeListener(ValueChangeListener
The listener)ValueChangeListener to be addedImplements javax. Add a new |
| public void | clearInitialState()
Overrides javax. Implements javax. For each of the attached objects on
this instance that implement |
| protected boolean | Returns: true if the new value is different from the
previous value, false otherwise.old value of this component (if any) previous, Object new value of this component (if any) value)Return |
| private boolean | |
| public void | decode(FacesContext
FacesContext for the request we are processingOverrides javax. Decode any new state of this |
| private void | |
| protected Object | Returns: the converted value.the Faces context. context, Object the new submitted value. newSubmittedValue)Convert the submitted value into a "local value" of the appropriate data type, if necessary. |
| public String | Returns: the converter message.If there has been a call to |
| private Converter | |
| public String | getFamily()
Overrides javax. Return the identifier of the component family to which this component belongs. |
| public String | Returns: the required message.If there has been a call to |
| public Object | getSubmittedValue()
Implements javax. Return the submittedValue value of this |
| public MethodBinding | getValidator()
Implements javax.
Deprecated
getValidators should be used instead.
Return a |
| public String | Returns: the validator message.If there has been a call to |
| public Validator | getValidators()
Implements javax. Return the set of registered |
| public Object | getValue()
Overrides javax. Implements javax. If there is a local value, return it,
otherwise return the result of calling |
| public MethodBinding | getValueChangeListener()
Implements javax.
Deprecated
as a consequence of
MethodBinding being deprecated.
If |
| public ValueChangeListener[] | getValueChangeListeners()
Implements javax. Return the set of registered |
| private boolean | |
| public static boolean | |
| public boolean | isImmediate()
Implements javax. Return the "immediate" state for this component. |
| public boolean | isLocalValueSet()
Implements javax. |
| public boolean | isRequired()
Implements javax. Return the "required field" state for this component. |
| private boolean | |
| public boolean | isValid()
Implements javax. Return a flag indicating whether the local value of this component is valid (no conversion error has occurred). |
| public void | markInitialState()
Overrides javax. Implements javax.
In addition to the actions taken in |
| public void | processDecodes(FacesContext
FacesContext for the request we are processingOverrides javax. Specialized decode behavior on top of that provided by the superclass. |
| public void | processUpdates(FacesContext
FacesContext for the request we are processingOverrides javax. In addition to the standard |
| public void | processValidators(FacesContext
FacesContext for the request we are processingOverrides javax. In addition to the standard
|
| public void | removeValidator(Validator<T>
The validator)Validator to removeImplements javax. Remove a |
| public void | removeValueChangeListener(ValueChangeListener
The listener)ValueChangeListener to be removedImplements javax. Remove an existing |
| public void | resetValue()
Overrides javax. Implements javax. Convenience method to reset this component's value to the un-initialized state. |
| public void | restoreState(FacesContext
the Faces context. context, Object the state. state)Overrides javax. Implements javax. Perform any processing required to restore the state from the entries in the state Object. |
| public Object | saveState(FacesContext
the Faces context. context)Overrides javax. Implements javax. Gets the state of the instance as a
|
| public void | setConverterMessage(String
the literal message value to be displayed in the event
conversion fails. message)Override any |
| public void | setImmediate(boolean
The new "immediate" state immediate)Implements javax. Set the "immediate" state for this component. |
| public void | setLocalValueSet(boolean
the "local value set" boolean. localValueSet)Implements javax. |
| public void | setRequired(boolean
The new "required field" state required)Implements javax. Set the "required field" state for this component. |
| public void | setRequiredMessage(String
the literal message value to be displayed in the event
the user hasn't supplied a value and one is required. message)Override any |
| public void | setSubmittedValue(Object
The new submitted value submittedValue)Implements javax. Set the submittedValue value of this |
| public void | setValid(boolean
The new valid flag valid)Implements javax. Set a flag indicating whether the local value of this component is valid (no conversion error has occurred). |
| public void | setValidator(MethodBinding
The new validatorBinding)MethodBinding instanceImplements javax.
Deprecated
Use
addValidator instead, obtaining the
argument Validator by creating an instance of javax.faces.validator.MethodExpressionValidator.
Set a |
| public void | setValidatorMessage(String
the literal message value to be displayed in the event
validation fails. message)Override any |
| public void | setValue(Object
The new local value value)Overrides javax. Implements javax. Set the value of this |
| public void | setValueChangeListener(MethodBinding
the value change listener. valueChangeListener)Implements javax.
Deprecated
Use
addValueChangeListener instead, obtaining the
argument ValueChangeListener by creating an instance of javax.faces.event.MethodExpressionValueChangeListener.
Wrap the argument |
| public void | updateModel(FacesContext
FacesContext for the request we are processingPerform
the following algorithm to update the model data
associated with this |
| public void | validate(FacesContext
The context)FacesContext for the current requestPerform the following algorithm to
validate the local value of this |
| private boolean | |
| protected void | validateValue(FacesContext
the Faces context. context, Object the new value. newValue)Set the "valid" property according to the below algorithm. |