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 jakarta.s 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 jakarta. The standard component family for this component. |
| public static final String | COMPONENT_TYPE
Hides jakarta. 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 jakarta.
Add a |
| public void | addValueChangeListener(ValueChangeListener
The listener)ValueChangeListener to be addedImplements jakarta.
Add a new |
| public void | clearInitialState()
Overrides jakarta. Implements jakarta.
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 |
| pack-priv boolean | |
| public void | decode(FacesContext
FacesContext for the request we are processingOverrides jakarta.
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 jakarta. 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 jakarta.
Return the submittedValue value of this |
| public String | Returns: the validator message.
If there has been a call to |
| public Validator | getValidators()
Implements jakarta.
Return the set of registered |
| public Object | getValue()
Overrides jakarta. Implements jakarta.
If there is a local value, return it, otherwise return the result of calling |
| public ValueChangeListener[] | getValueChangeListeners()
Implements jakarta.
Return the set of registered |
| private boolean | |
| public static boolean | |
| public boolean | isImmediate()
Implements jakarta. Return the "immediate" state for this component. |
| public boolean | isLocalValueSet()
Implements jakarta. Return the "local value set" state for this component. |
| public boolean | isRequired()
Implements jakarta. Return the "required field" state for this component. |
| private boolean | |
| public boolean | isValid()
Implements jakarta. Return a flag indicating whether the local value of this component is valid (no conversion error has occurred). |
| public void | markInitialState()
Overrides jakarta. Implements jakarta.
In addition to the actions taken in |
| public void | processDecodes(FacesContext
FacesContext for the request we are processingOverrides jakarta. Specialized decode behavior on top of that provided by the superclass. |
| public void | processUpdates(FacesContext
FacesContext for the request we are processingOverrides jakarta.
In addition to the standard |
| public void | processValidators(FacesContext
FacesContext for the request we are processingOverrides jakarta.
In addition to the standard |
| public void | removeValidator(Validator<T>
The validator)Validator to removeImplements jakarta.
Remove a |
| public void | removeValueChangeListener(ValueChangeListener
The listener)ValueChangeListener to be removedImplements jakarta.
Remove an existing |
| public void | resetValue()
Overrides jakarta. Implements jakarta. 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 jakarta. Implements jakarta. Perform any processing required to restore the state from the entries in the state Object. |
| public Object | saveState(FacesContext
the Faces context. context)Overrides jakarta. Implements jakarta.
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 jakarta. Set the "immediate" state for this component. |
| public void | setLocalValueSet(boolean
the "local value set" boolean. localValueSet)Implements jakarta. Sets the "local value set" state for this component. |
| public void | setRequired(boolean
The new "required field" state required)Implements jakarta. 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 jakarta.
Set the submittedValue value of this |
| public void | setValid(boolean
The new valid flag valid)Implements jakarta. Set a flag indicating whether the local value of this component is valid (no conversion error has occurred). |
| 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 jakarta. Implements jakarta.
Set the value of this |
| public void | updateModel(FacesContext
FacesContext for the request we are processing
Perform the following algorithm to update the model data associated with
this |
| public void | validate(FacesContext
The context)FacesContext for the current request
Perform 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. |