|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
public class UIInput
| Type | Phases | Description |
|---|---|---|
javax.faces.event.ValueChangeEvent |
The valueChange event is delivered when the value attribute is changed. |
| Field Summary | |
|---|---|
static java.lang.String |
COMPONENT_FAMILY
|
static java.lang.String |
COMPONENT_TYPE
|
static java.lang.String |
CONVERSION_MESSAGE_ID
|
static java.lang.String |
REQUIRED_MESSAGE_ID
|
static java.lang.String |
UPDATE_MESSAGE_ID
|
| Fields inherited from class javax.faces.component.UIComponent |
|---|
bindings |
| Constructor Summary | |
|---|---|
UIInput()
Construct an instance of the UIInput. |
|
| Method Summary | |
|---|---|
void |
addValidator(Validator validator)
Adds a A method which is invoked during the validation phase for this component. |
void |
addValueChangeListener(ValueChangeListener listener)
Adds a valueChange listener. |
void |
broadcast(FacesEvent event)
Invoke any listeners attached to this object which are listening for an event whose type matches the specified event's runtime type. |
protected boolean |
compareValues(java.lang.Object previous,
java.lang.Object value)
|
void |
decode(FacesContext context)
Check the submitted form parameters for data associated with this component. |
protected java.lang.Object |
getConvertedValue(FacesContext context,
java.lang.Object submittedValue)
Convert the provided object to the desired value. |
java.lang.String |
getConverterMessage()
Gets Text of the converter message. |
java.lang.String |
getFamily()
|
java.lang.String |
getRequiredMessage()
Gets Text which will be shown if a required value is not submitted. |
java.lang.Object |
getSubmittedValue()
Gets the current submitted value. |
MethodBinding |
getValidator()
Deprecated. |
java.lang.String |
getValidatorMessage()
Gets Text which will be shown, if validation fails. |
Validator[] |
getValidators()
Gets all A method which is invoked during the validation phase for this component. |
MethodBinding |
getValueChangeListener()
Deprecated. |
ValueChangeListener[] |
getValueChangeListeners()
Returns an array of attached valueChange listeners. |
boolean |
isImmediate()
Gets A boolean value that identifies the phase during which action events should fire. |
boolean |
isLocalValueSet()
Gets whether a local value is currently set. |
boolean |
isRequired()
Gets A boolean value that indicates whether a value is required. |
boolean |
isValid()
Gets whether the component's value is currently valid |
void |
processDecodes(FacesContext context)
Set the "submitted value" of this component from the relevant data in the current servet request object. |
void |
processUpdates(FacesContext context)
This isn't an input component, so just pass on the processUpdates call to child components and facets that might be input components. |
void |
processValidators(FacesContext context)
|
void |
removeValidator(Validator validator)
Removes a A method which is invoked during the validation phase for this component. |
void |
removeValueChangeListener(ValueChangeListener listener)
Removes a valueChange listener. |
void |
resetValue()
|
void |
restoreState(FacesContext facesContext,
java.lang.Object state)
Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object. |
java.lang.Object |
saveState(FacesContext facesContext)
Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has. |
void |
setConverterMessage(java.lang.String converterMessage)
Sets Text of the converter message. |
void |
setImmediate(boolean immediate)
Sets A boolean value that identifies the phase during which action events should fire. |
void |
setLocalValueSet(boolean localValueSet)
Sets whether a local value is currently set. |
void |
setRequired(boolean required)
Sets A boolean value that indicates whether a value is required. |
void |
setRequiredMessage(java.lang.String requiredMessage)
Sets Text which will be shown if a required value is not submitted. |
void |
setSubmittedValue(java.lang.Object submittedValue)
Sets the current submitted value. |
void |
setValid(boolean valid)
Sets whether the component's value is currently valid |
void |
setValidator(MethodBinding validator)
Deprecated. |
void |
setValidatorMessage(java.lang.String validatorMessage)
Sets Text which will be shown, if validation fails. |
void |
setValue(java.lang.Object value)
Store the specified object as the "local value" of this component. |
void |
setValueChangeListener(MethodBinding valueChangeListener)
Deprecated. |
void |
updateModel(FacesContext context)
|
void |
validate(FacesContext context)
Determine whether the new value is valid, and queue a ValueChangeEvent if necessary. |
protected void |
validateValue(FacesContext context,
java.lang.Object convertedValue)
|
| Methods inherited from class javax.faces.component.UIOutput |
|---|
getConverter, getLocalValue, getValue, setConverter |
| Methods inherited from class javax.faces.component.UIComponentBase |
|---|
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding |
| Methods inherited from class javax.faces.component.UIComponent |
|---|
encodeAll, getContainerClientId, getValueExpression, setValueExpression |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.faces.component.ValueHolder |
|---|
getConverter, getLocalValue, getValue, setConverter |
| Field Detail |
|---|
public static final java.lang.String COMPONENT_FAMILY
public static final java.lang.String COMPONENT_TYPE
public static final java.lang.String CONVERSION_MESSAGE_ID
public static final java.lang.String REQUIRED_MESSAGE_ID
public static final java.lang.String UPDATE_MESSAGE_ID
| Constructor Detail |
|---|
public UIInput()
| Method Detail |
|---|
public void setValue(java.lang.Object value)
setValue in interface ValueHoldersetValue in class UIOutputvalue - the new value valuepublic void processDecodes(FacesContext context)
If this component is not rendered, then do nothing; no output would have been sent to the client so no input is expected.
Invoke the inherited functionality, which typically invokes the renderer associated with this component to extract and set this component's "submitted value".
If this component is marked "immediate", then immediately apply validation to the submitted value found. On error, call context method "renderResponse" which will force processing to leap to the "render response" phase as soon as the "decode" step has completed for all other components.
processDecodes in class UIComponentBasepublic void processValidators(FacesContext context)
processValidators in class UIComponentBasepublic void processUpdates(FacesContext context)
UIComponentBaseComponents that were never rendered can't possibly be receiving update data (no corresponding fields were ever put into the response) so if this component is not rendered then this method does not invoke processUpdates on its children.
processUpdates in class UIComponentBasepublic void decode(FacesContext context)
UIComponentBase
decode in class UIComponentBase
public void broadcast(FacesEvent event)
throws AbortProcessingException
UIComponentBaseThis method does not propagate the event up to parent components, ie listeners attached to parent components don't automatically get called.
If any of the listeners throws AbortProcessingException then that exception will prevent any further listener callbacks from occurring, and the exception propagates out of this method without alteration.
ActionEvent events are typically queued by the renderer associated with this component in its decode method; ValueChangeEvent events by the component's validate method. In either case the event's source property references a component. At some later time the UIViewRoot component iterates over its queued events and invokes the broadcast method on each event's source object.
broadcast in class UIComponentBaseevent - must not be null.
AbortProcessingExceptionpublic void updateModel(FacesContext context)
protected void validateValue(FacesContext context,
java.lang.Object convertedValue)
public void validate(FacesContext context)
The "submitted value" is converted to the necessary type; conversion failure is reported as an error and validation processing terminates for this component. See documentation for method getConvertedValue for details on the conversion process.
Any validators attached to this component are then run, passing the converted value.
The old value of this component is then fetched (possibly involving the evaluation of a value-binding expression, ie invoking a method on a user object). The old value is compared to the new validated value, and if they are different then a ValueChangeEvent is queued for later processing.
On successful completion of this method:
protected java.lang.Object getConvertedValue(FacesContext context,
java.lang.Object submittedValue)
If there is a renderer for this component, then call the renderer's getConvertedValue method. While this can of course be implemented in any way the renderer desires, it typically performs exactly the same processing that this method would have done anyway (ie that described below for the no-renderer case).
Otherwise:
protected boolean compareValues(java.lang.Object previous,
java.lang.Object value)
public void resetValue()
public boolean isImmediate()
isImmediate in interface EditableValueHolderpublic void setImmediate(boolean immediate)
setImmediate in interface EditableValueHolderimmediate - the new immediate valuepublic boolean isRequired()
isRequired in interface EditableValueHolderpublic void setRequired(boolean required)
setRequired in interface EditableValueHolderrequired - the new required valuepublic java.lang.String getConverterMessage()
public void setConverterMessage(java.lang.String converterMessage)
converterMessage - the new converterMessage valuepublic java.lang.String getRequiredMessage()
public void setRequiredMessage(java.lang.String requiredMessage)
requiredMessage - the new requiredMessage valuepublic MethodBinding getValidator()
getValidator in interface EditableValueHolderpublic void setValidator(MethodBinding validator)
setValidator in interface EditableValueHoldervalidator - the new validator valuepublic void addValidator(Validator validator)
addValidator in interface EditableValueHolderpublic void removeValidator(Validator validator)
removeValidator in interface EditableValueHolderpublic Validator[] getValidators()
getValidators in interface EditableValueHolderpublic java.lang.String getValidatorMessage()
public void setValidatorMessage(java.lang.String validatorMessage)
validatorMessage - the new validatorMessage valuepublic MethodBinding getValueChangeListener()
getValueChangeListener in interface EditableValueHolderpublic void setValueChangeListener(MethodBinding valueChangeListener)
setValueChangeListener in interface EditableValueHoldervalueChangeListener - the new valueChangeListener valuepublic boolean isValid()
isValid in interface EditableValueHolderpublic void setValid(boolean valid)
setValid in interface EditableValueHoldervalid - the new valid valuepublic boolean isLocalValueSet()
isLocalValueSet in interface EditableValueHolderpublic void setLocalValueSet(boolean localValueSet)
setLocalValueSet in interface EditableValueHolderlocalValueSet - the new localValueSet valuepublic java.lang.Object getSubmittedValue()
getSubmittedValue in interface EditableValueHolderpublic void setSubmittedValue(java.lang.Object submittedValue)
setSubmittedValue in interface EditableValueHoldersubmittedValue - the new submittedValue valuepublic void addValueChangeListener(ValueChangeListener listener)
addValueChangeListener in interface EditableValueHolderlistener - the valueChange listener to addpublic void removeValueChangeListener(ValueChangeListener listener)
removeValueChangeListener in interface EditableValueHolderlistener - the valueChange listener to removepublic ValueChangeListener[] getValueChangeListeners()
getValueChangeListeners in interface EditableValueHolderpublic java.lang.Object saveState(FacesContext facesContext)
UIComponentBase
saveState in interface StateHoldersaveState in class UIOutput
public void restoreState(FacesContext facesContext,
java.lang.Object state)
UIComponentBase
restoreState in interface StateHolderrestoreState in class UIOutputstate - is an object previously returned by
the saveState method of this class.public java.lang.String getFamily()
getFamily in class UIOutput
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||