|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
UIInput is a UIComponent that represents
a component that both displays output to the user (like
UIOutput components do) and includes 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 reference expression (if any); however, individual
Renderers will generally impose restrictions
on the type of data they know how to display.
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
ValueChangedEvent. Later on, the broadcast()
method will ensure that this event is broadcast to all interested
listeners.
By default, the rendererType property is set to
"Text". This value can be changed by calling the
setRendererType() method.
| Field Summary | |
protected java.util.List[] |
listeners
Array of Lists of ValueChangedListeners registered
for particular phases. |
| Fields inherited from interface javax.faces.component.UIComponent |
SEPARATOR_CHAR |
| Constructor Summary | |
UIInput()
Create a new UIInput instance with default property
values. |
|
| Method Summary | |
void |
addValueChangedListener(ValueChangedListener listener)
Add a new ValueChangedListener to the set of listeners
interested in being notified when ValueChangedEvents occur. |
boolean |
broadcast(FacesEvent event,
PhaseId phaseId)
Broadcast the specified FacesEvent to all registered
event listeners who have expressed an interest in events of this
type, for the specified PhaseId. |
protected void |
broadcast(ValueChangedEvent event,
java.util.List list)
Broadcast the specified ValueChangedEvent to the
ValueChangedListeners on the specified list (if any) |
protected boolean |
compareValues(java.lang.Object previous,
java.lang.Object value)
Return true if the new value is different from the
previous value. |
protected void |
fireValueChangedEvent(FacesContext context,
java.lang.Object oldValue,
java.lang.Object newValue)
Queue an ValueChangedEvent for processing during the next
event processing cycle. |
java.lang.Object |
getPrevious()
Return the previous value of this UIInput component. |
void |
removeValueChangedListener(ValueChangedListener listener)
Remove an existing ValueChangedListener (if any) from the
set of listeners interested in being notified when
ValueChangedEvents occur. |
void |
setPrevious(java.lang.Object previous)
Set the previous value of this UIInput component. |
void |
updateModel(FacesContext context)
Perform the following algorithm to update the model data associated with this UIInput, if any, as appropriate. |
void |
validate(FacesContext context)
Perform validations and, if validation is successful, and the local value is different from the previous value, queue a ValueChangedEvent to be processed later. |
| Methods inherited from class javax.faces.component.UIOutput |
currentValue, getValue, getValueRef, setValue, setValueRef |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.List[] listeners
Array of Lists of ValueChangedListeners registered
for particular phases. The array, as well as the individual
elements, are lazily instantiated as necessary.
| Constructor Detail |
public UIInput()
Create a new UIInput instance with default property
values.
| Method Detail |
public java.lang.Object getPrevious()
Return the previous value of this UIInput component.
This method should only be utilized by the decode()
method of this component, or its corresponding
Renderer.
public void setPrevious(java.lang.Object previous)
Set the previous value of this UIInput component.
This method should only be utilized by the decode()
method of this component, or its corresponding
Renderer.
previous - The new previous valuepublic void updateModel(FacesContext context)
Perform the following algorithm to update the model data
associated with this UIInput, if any, as appropriate.
valid property of this component is
false, take no further action.valueRef property of this component
is null, take no further action.Application instance for this web application
from ApplicationFactory.ValueBinding for the valueRef
expression.setValue() method of the
ValueBinding to update the value that the
value reference expression points at.setValue() method returns successfully:
setValue() method call fails:
addMessage()
on the specified FacesContext instance.valid property of this UIInput
to false.
updateModel in interface UIComponentupdateModel in class UIComponentBasecontext - FacesContext for the request we are processing
java.lang.IllegalArgumentException - if the valueRef
property has invalid syntax for an expression
java.lang.NullPointerException - if context
is nullpublic void validate(FacesContext context)
Perform validations and, if validation is successful, and the
local value is different from the previous value, queue
a ValueChangedEvent to be processed later.
validate in interface UIComponentvalidate in class UIComponentBasecontext - The FacesContext for the current request
java.lang.NullPointerException - if context
is null
protected boolean compareValues(java.lang.Object previous,
java.lang.Object value)
Return true if the new value is different from the
previous value.
previous - old value of this componentvalue - new value of this componentpublic void addValueChangedListener(ValueChangedListener listener)
Add a new ValueChangedListener to the set of listeners
interested in being notified when ValueChangedEvents occur.
listener - The ValueChangedListener to be added
java.lang.NullPointerException - if listener
is null
public boolean broadcast(FacesEvent event,
PhaseId phaseId)
throws AbortProcessingException
Broadcast the specified FacesEvent to all registered
event listeners who have expressed an interest in events of this
type, for the specified PhaseId. The order in which
registered listeners are notified is implementation dependent.
After all interested listeners have been notified, return
false if this event does not have any listeners
interested in this event in future phases of the request processing
lifecycle. Otherwise, return true.
broadcast in interface UIComponentbroadcast in class UIComponentBaseevent - The FacesEvent to be broadcastphaseId - The PhaseId of the current phase of the
request processing lifecycle
AbortProcessingException - Signal the JavaServer Faces
implementation that no further processing on the current event
should be performed
java.lang.IllegalArgumentException - if the implementation class
of this FacesEvent is not supported by this component
java.lang.IllegalStateException - if PhaseId.ANY_PHASE is passed
for the phase identifier
java.lang.NullPointerException - if event or
phaseId is null
protected void broadcast(ValueChangedEvent event,
java.util.List list)
Broadcast the specified ValueChangedEvent to the
ValueChangedListeners on the specified list (if any)
event - The ValueChangedEvent to be broadcastlist - The list of ValueChangedListeners, or
null for no interested listeners
protected void fireValueChangedEvent(FacesContext context,
java.lang.Object oldValue,
java.lang.Object newValue)
Queue an ValueChangedEvent for processing during the next
event processing cycle.
context - The FacesContext for the current requestoldValue - The original value of this componentnewValue - The new value of this componentpublic void removeValueChangedListener(ValueChangedListener listener)
Remove an existing ValueChangedListener (if any) from the
set of listeners interested in being notified when
ValueChangedEvents occur.
listener - The ValueChangedListener to be removed
java.lang.NullPointerException - if listener
is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||