Class Hierarchy All Classes All Fields and Methods

 

Class javax.faces.component.UIInput

java.lang.Object
        javax.faces.component.UIComponent
                javax.faces.component.UIComponentBase
                        javax.faces.component.UIOutput
                                javax.faces.component.UIInput

public class UIInput
implements EditableValueHolder
extends UIOutput

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 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.

By default, the rendererType property must be set to "Text". This value can be changed by calling the setRendererType() method.

Field Index
Field Description
COMPONENT_FAMILY The standard component family for this component.
COMPONENT_TYPE The standard component type for this component.
CONVERSION_MESSAGE_ID The message identifier of the FacesMessage to be created if a conversion error occurs, and the ConverterException does not provide a message.
REQUIRED_MESSAGE_ID The message identifier of the FacesMessage to be created if a required check fails.

Constructor Index
Constructor Description
UIInput() Create a new UIInput instance with default property values.

Method Index
Method Description
void addValidator(Validator) Add a Validator instance to the set associated with this UIInput.
void addValueChangeListener(ValueChangeListener) Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.
void broadcast(FacesEvent) In addition to to the default broadcast processing, pass the ValueChangeEvent being broadcast to the method referenced by valueChangeListener (if any).
boolean compareValues(Object, Object) Return true if the new value is different from the previous value.
void decode(FacesContext)  
String getFamily()  
Object getSubmittedValue() Return the submittedValue value of this UIInput component.
MethodBinding getValidator() Return a MethodBinding pointing at a method that will be called during Process Validations phase of the request processing lifecycle, to validate the current value of this component.
Validator[] getValidators() Return the set of registered Validators for this UIInput instance.
MethodBinding getValueChangeListener() Return a MethodBinding instance method that will be called during Process Validations phase of he request processing lifecycle, after any registered ValueChangeListeners have been notified of a value change.
ValueChangeListener[] getValueChangeListeners() Return the set of registered ValueChangeListeners for this UIInput instance.
boolean isImmediate()  
boolean isLocalValueSet() Return the "local value set" state for this component.
boolean isRequired() Return the "required field" state for this component.
boolean isValid()  
void processDecodes(FacesContext) Specialized decode behavior on top of that provided by the superclass.
void processUpdates(FacesContext) In addition to the standard processUpdates behavior inherited from UIComponentBase, calls updateModel().
void processValidators(FacesContext) In addition to the standard processValidators behavior inherited from UIComponentBase, calls validate() if the immediate property is false (which is the default); if the component is invalid afterwards, calls renderResponse.
void removeValidator(Validator) Remove a Validator instance from the set associated with this UIInput, if it was previously associated.
void removeValueChangeListener(ValueChangeListener) Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.
void restoreState(FacesContext, Object)  
Object saveState(FacesContext)  
void setImmediate(boolean)  
void setLocalValueSet(boolean) Sets the "local value set" state for this component.
void setRequired(boolean) Set the "required field" state for this component.
void setSubmittedValue(Object) Set the submittedValue value of this UIInput component.
void setValid(boolean)  
void setValidator(MethodBinding) Set a MethodBinding pointing at a method that will be called during Process Validations phase of the request processing lifecycle, to validate the current value of this component.
void setValue(Object)  
void setValueChangeListener(MethodBinding) Set a MethodBinding instance a that will be called during Process Validations phase of he request processing lifecycle, after any registered ValueChangeListeners have been notified of a value change.
void updateModel(FacesContext) Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate.
void validate(FacesContext) Perform the following algorithm to validate the local value of this UIInput.

 

Fields

 

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY

The standard component family for this component.

 

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE

The standard component type for this component.

 

CONVERSION_MESSAGE_ID

public static final java.lang.String CONVERSION_MESSAGE_ID

The message identifier of the FacesMessage to be created if a conversion error occurs, and the ConverterException does not provide a message.

 

REQUIRED_MESSAGE_ID

public static final java.lang.String REQUIRED_MESSAGE_ID

The message identifier of the FacesMessage to be created if a required check fails.

 

Constructors

 

UIInput

public UIInput() 

Create a new UIInput instance with default property values.

 

Methods

 

addValidator

public void addValidator(Validator validator) 

Add a Validator instance to the set associated with this UIInput.

 

addValueChangeListener

public void addValueChangeListener(ValueChangeListener listener) 

Add a new ValueChangeListener to the set of listeners interested in being notified when ValueChangeEvents occur.

 

broadcast

public void broadcast(FacesEvent event) throws AbortProcessingException

In addition to to the default broadcast processing, pass the ValueChangeEvent being broadcast to the method referenced by valueChangeListener (if any).

 

compareValues

protected boolean compareValues(Object previous,
                                Object value) 

Return true if the new value is different from the previous value.

 

decode

public void decode(FacesContext context) 

 

getFamily

public String getFamily() 

 

getSubmittedValue

public Object getSubmittedValue() 

Return the submittedValue value of this UIInput component. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer.

 

getValidator

public MethodBinding getValidator() 

Return a MethodBinding pointing at a method that will be called during Process Validations phase of the request processing lifecycle, to validate the current value of this component.

 

getValidators

public Validator[] getValidators() 

Return the set of registered Validators for this UIInput instance. If there are no registered validators, a zero-length array is returned.

 

getValueChangeListener

public MethodBinding getValueChangeListener() 

Return a MethodBinding instance method that will be called during Process Validations phase of he request processing lifecycle, after any registered ValueChangeListeners have been notified of a value change.

 

getValueChangeListeners

public ValueChangeListener[] getValueChangeListeners() 

Return the set of registered ValueChangeListeners for this UIInput instance. If there are no registered listeners, a zero-length array is returned.

 

isImmediate

public boolean isImmediate() 

 

isLocalValueSet

public boolean isLocalValueSet() 

Return the "local value set" state for this component. Calls to setValue() automatically reset this property to true.

 

isRequired

public boolean isRequired() 

Return the "required field" state for this component.

 

isValid

public boolean isValid() 

 

processDecodes

public void processDecodes(FacesContext context) 

Specialized decode behavior on top of that provided by the superclass. In addition to the standard processDecodes behavior inherited from UIComponentBase, calls validate() if the the immediate property is true; if the component is invalid afterwards or a RuntimeException is thrown, calls renderResponse.

 

processUpdates

public void processUpdates(FacesContext context) 

In addition to the standard processUpdates behavior inherited from UIComponentBase, calls updateModel(). If the component is invalid afterwards, calls renderResponse. If a RuntimeException is thrown during update processing, calls renderResponse and re-throw the exception.

 

processValidators

public void processValidators(FacesContext context) 

In addition to the standard processValidators behavior inherited from UIComponentBase, calls validate() if the immediate property is false (which is the default); if the component is invalid afterwards, calls renderResponse. If a RuntimeException is thrown during validation processing, calls renderResponse and re-throw the exception.

 

removeValidator

public void removeValidator(Validator validator) 

Remove a Validator instance from the set associated with this UIInput, if it was previously associated. Otherwise, do nothing.

 

removeValueChangeListener

public void removeValueChangeListener(ValueChangeListener listener) 

Remove an existing ValueChangeListener (if any) from the set of listeners interested in being notified when ValueChangeEvents occur.

 

restoreState

public void restoreState(FacesContext context,
                         Object state) 

 

saveState

public Object saveState(FacesContext context) 

 

setImmediate

public void setImmediate(boolean immediate) 

 

setLocalValueSet

public void setLocalValueSet(boolean localValueSet) 

Sets the "local value set" state for this component.

 

setRequired

public void setRequired(boolean required) 

Set the "required field" state for this component.

 

setSubmittedValue

public void setSubmittedValue(Object submittedValue) 

Set the submittedValue value of this UIInput component. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer.

 

setValid

public void setValid(boolean valid) 

 

setValidator

public void setValidator(MethodBinding validatorBinding) 

Set a MethodBinding pointing at a method that will be called during Process Validations phase of the request processing lifecycle, to validate the current value of this component.

Any method referenced by such an expression must be public, with a return type of void, and accept parameters of type FacesContext, UIComponent, and Object.

 

setValue

public void setValue(Object value) 

 

setValueChangeListener

public void setValueChangeListener(MethodBinding valueChangeMethod) 

Set a MethodBinding instance a that will be called during Process Validations phase of he request processing lifecycle, after any registered ValueChangeListeners have been notified of a value change.

 

updateModel

public void updateModel(FacesContext context) 

Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate.

 

validate

public void validate(FacesContext context) 

Perform the following algorithm to validate the local value of this UIInput.

Application components implementing UIInput that wish to perform validation with logic embedded in the component should perform their own correctness checks, and then call the super.validate() method to perform the standard processing described above.

Class Hierarchy All Classes All Fields and Methods