org.apache.myfaces.trinidad.component
Class UIXEditableValue

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by org.apache.myfaces.trinidad.component.UIXComponent
          extended by org.apache.myfaces.trinidad.component.UIXComponentBase
              extended by org.apache.myfaces.trinidad.component.UIXValue
                  extended by org.apache.myfaces.trinidad.component.UIXEditableValue
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
UIXInput, UIXSelectBoolean, UIXSelectInput, UIXSelectMany, UIXSelectOne

public abstract class UIXEditableValue
extends UIXValue
implements javax.faces.component.EditableValueHolder

Events:

Type Phases Description
javax.faces.event.ValueChangeEvent Apply Request Values The valueChange event is delivered when the value attribute is changed.
org.apache.myfaces.trinidad.event.AttributeChangeEvent Apply Request Values Event delivered to describe an attribute change. Attribute change events are not delivered for any programmatic change to a property. They are only delivered when a renderer changes a property without the application's specific request. An example of an attribute change events might include the width of a column that supported client-side resizing.


Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String CONVERSION_MESSAGE_ID
           
static PropertyKey IMMEDIATE_KEY
           
static PropertyKey LOCAL_VALUE_SET_KEY
           
static PropertyKey REQUIRED_KEY
           
static PropertyKey REQUIRED_MESSAGE_DETAIL_KEY
           
static java.lang.String REQUIRED_MESSAGE_ID
           
static PropertyKey SUBMITTED_VALUE_KEY
           
static FacesBean.Type TYPE
           
static PropertyKey VALID_KEY
           
static PropertyKey VALIDATOR_KEY
           
static PropertyKey VALIDATORS_KEY
           
static PropertyKey VALUE_CHANGE_LISTENER_KEY
           
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXValue
CONVERTER_KEY, VALUE_KEY
 
Fields inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
BINDING_KEY, ID_KEY, RENDERED_KEY, RENDERER_TYPE_KEY, TRANSIENT_KEY
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
protected UIXEditableValue()
          Construct an instance of the UIXEditableValue.
protected UIXEditableValue(java.lang.String rendererType)
          Construct an instance of the UIXEditableValue.
 
Method Summary
 void addValidator(javax.faces.validator.Validator validator)
           
 void addValueChangeListener(javax.faces.event.ValueChangeListener listener)
          Adds a valueChange listener.
 void broadcast(javax.faces.event.FacesEvent event)
          In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing, pass the ValueChangeEvent being broadcast to the method referenced by valueChangeListener (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  FacesBean.Type getBeanType()
           
protected  java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, java.lang.Object submittedValue)
           
 java.lang.String getFamily()
           
 java.lang.String getRequiredMessageDetail()
          Gets the message to be displayed, if 'required' validation fails.
protected  java.lang.String getRequiredMessageKey()
           
 java.lang.Object getSubmittedValue()
          Gets the current submitted value.
 javax.faces.el.MethodBinding getValidator()
          Deprecated.  
 javax.faces.validator.Validator[] getValidators()
           
 javax.faces.el.MethodBinding getValueChangeListener()
          Deprecated.  
 javax.faces.event.ValueChangeListener[] getValueChangeListeners()
          Returns an array of attached valueChange listeners.
protected  boolean isEmpty(java.lang.Object value)
          Return true if the value is empty.
 boolean isImmediate()
          Gets whether the value is converted and validated immediately in the Apply Request Values phase, or is handled in the Process Validators phase, the default.
 boolean isLocalValueSet()
          Gets whether a local value is currently set.
 boolean isRequired()
          Gets whether a non-null, non-empty value must be entered.
 boolean isValid()
          Gets whether the component's value is currently valid
 void processDecodes(javax.faces.context.FacesContext context)
          In addition to the standard processDecodes behavior inherited from UIXComponentBase, calls validate() if the the immediate property is true.
 void processUpdates(javax.faces.context.FacesContext context)
           
 void processValidators(javax.faces.context.FacesContext context)
           
 void removeValidator(javax.faces.validator.Validator validator)
           
 void removeValueChangeListener(javax.faces.event.ValueChangeListener listener)
          Removes a valueChange listener.
 void resetValue()
          Convenience method to reset this component's value to an uninitialized state, by resetting the local value and submitted values to null (ensuring that isLocalValueSet() is false), and setting "valid" to true.
 void setImmediate(boolean immediate)
          Sets whether the value is converted and validated immediately in the Apply Request Values phase, or is handled in the Process Validators phase, the default.
 void setLocalValueSet(boolean localValueSet)
          Sets whether a local value is currently set.
 void setRequired(boolean required)
          Sets whether a non-null, non-empty value must be entered.
 void setRequiredMessageDetail(java.lang.String requiredMessageDetail)
          Sets the message to be displayed, if 'required' validation fails.
 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(javax.faces.el.MethodBinding validator)
          Deprecated.  
 void setValueChangeListener(javax.faces.el.MethodBinding valueChangeListener)
          Deprecated.  
 void updateModel(javax.faces.context.FacesContext context)
           
 void validate(javax.faces.context.FacesContext context)
           
protected  void validateValue(javax.faces.context.FacesContext context, java.lang.Object newValue)
           
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXValue
getConverter, getLocalValue, getValue, setConverter, setValue
 
Methods inherited from class org.apache.myfaces.trinidad.component.UIXComponentBase
adaptMethodBinding, addAttributeChange, addAttributeChangeListener, addFacesListener, broadcastToMethodBinding, broadcastToMethodExpression, createFacesBean, decode, decodeChildren, decodeChildrenImpl, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributeChangeListener, getAttributeChangeListeners, getAttributes, getBooleanProperty, getChildCount, getChildren, getClientId, getFacesBean, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacetNames, getFacets, getFacetsAndChildren, getId, getIntProperty, getLifecycleRenderer, getParent, getProperty, getPropertyKey, getRenderer, getRendererType, getRendersChildren, getValueBinding, getValueExpression, isRendered, isTransient, markInitialState, processRestoreState, processSaveState, queueEvent, removeAttributeChangeListener, removeFacesListener, restoreState, saveState, setAttributeChangeListener, setAttributeChangeListener, setBooleanProperty, setId, setIntProperty, setParent, setProperty, setRendered, setRendererType, setTransient, setValueBinding, setValueExpression, toString, updateChildren, updateChildrenImpl, validateChildren, validateChildrenImpl
 
Methods inherited from class javax.faces.component.UIComponent
getContainerClientId, invokeOnComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter, setValue
 

Field Detail

TYPE

public static final FacesBean.Type TYPE

IMMEDIATE_KEY

public static final PropertyKey IMMEDIATE_KEY

VALID_KEY

public static final PropertyKey VALID_KEY

REQUIRED_KEY

public static final PropertyKey REQUIRED_KEY

LOCAL_VALUE_SET_KEY

public static final PropertyKey LOCAL_VALUE_SET_KEY

SUBMITTED_VALUE_KEY

public static final PropertyKey SUBMITTED_VALUE_KEY

VALIDATOR_KEY

public static final PropertyKey VALIDATOR_KEY

VALUE_CHANGE_LISTENER_KEY

public static final PropertyKey VALUE_CHANGE_LISTENER_KEY

REQUIRED_MESSAGE_DETAIL_KEY

public static final PropertyKey REQUIRED_MESSAGE_DETAIL_KEY

COMPONENT_FAMILY

public static final java.lang.String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE
See Also:
Constant Field Values

VALIDATORS_KEY

public static final PropertyKey VALIDATORS_KEY

REQUIRED_MESSAGE_ID

public static final java.lang.String REQUIRED_MESSAGE_ID
See Also:
Constant Field Values

CONVERSION_MESSAGE_ID

public static final java.lang.String CONVERSION_MESSAGE_ID
See Also:
Constant Field Values
Constructor Detail

UIXEditableValue

protected UIXEditableValue(java.lang.String rendererType)
Construct an instance of the UIXEditableValue.


UIXEditableValue

protected UIXEditableValue()
Construct an instance of the UIXEditableValue.

Method Detail

resetValue

public void resetValue()
Convenience method to reset this component's value to an uninitialized state, by resetting the local value and submitted values to null (ensuring that isLocalValueSet() is false), and setting "valid" to true.


addValidator

public void addValidator(javax.faces.validator.Validator validator)
Specified by:
addValidator in interface javax.faces.component.EditableValueHolder

getValidators

public javax.faces.validator.Validator[] getValidators()
Specified by:
getValidators in interface javax.faces.component.EditableValueHolder

removeValidator

public void removeValidator(javax.faces.validator.Validator validator)
Specified by:
removeValidator in interface javax.faces.component.EditableValueHolder

validate

public void validate(javax.faces.context.FacesContext context)

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent) processing, pass the ValueChangeEvent being broadcast to the method referenced by valueChangeListener (if any).

Overrides:
broadcast in class UIXComponentBase
Parameters:
event - FacesEvent to be broadcast
Throws:
javax.faces.event.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.NullPointerException - if event is null

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
In addition to the standard processDecodes behavior inherited from UIXComponentBase, calls validate() if the the immediate property is true. Iif the component is invalid afterwards or a RuntimeException is thrown, calls FacesContext.renderResponse().

Overrides:
processDecodes in class UIXComponentBase

processUpdates

public void processUpdates(javax.faces.context.FacesContext context)
Overrides:
processUpdates in class UIXComponentBase

processValidators

public void processValidators(javax.faces.context.FacesContext context)
Overrides:
processValidators in class UIXComponentBase

updateModel

public void updateModel(javax.faces.context.FacesContext context)

validateValue

protected void validateValue(javax.faces.context.FacesContext context,
                             java.lang.Object newValue)

getRequiredMessageKey

protected java.lang.String getRequiredMessageKey()

getConvertedValue

protected java.lang.Object getConvertedValue(javax.faces.context.FacesContext context,
                                             java.lang.Object submittedValue)
                                      throws javax.faces.convert.ConverterException
Throws:
javax.faces.convert.ConverterException

compareValues

protected boolean compareValues(java.lang.Object previous,
                                java.lang.Object value)

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

Parameters:
previous - old value of this component (if any)
value - new value of this component (if any)

isEmpty

protected boolean isEmpty(java.lang.Object value)

Return true if the value is empty.


isImmediate

public final boolean isImmediate()
Gets whether the value is converted and validated immediately in the Apply Request Values phase, or is handled in the Process Validators phase, the default. By default, values are converted and validated together in the Process Validators phase. However, if you need access to the value of a component during Apply Request Values - for example, if you need to get the value from an actionListener on an immediate commandButton - then setting this to "immediate" makes that possible.

Specified by:
isImmediate in interface javax.faces.component.EditableValueHolder
Returns:
the new immediate value

setImmediate

public final void setImmediate(boolean immediate)
Sets whether the value is converted and validated immediately in the Apply Request Values phase, or is handled in the Process Validators phase, the default. By default, values are converted and validated together in the Process Validators phase. However, if you need access to the value of a component during Apply Request Values - for example, if you need to get the value from an actionListener on an immediate commandButton - then setting this to "immediate" makes that possible.

Specified by:
setImmediate in interface javax.faces.component.EditableValueHolder
Parameters:
immediate - the new immediate value

isValid

public final boolean isValid()
Gets whether the component's value is currently valid

Specified by:
isValid in interface javax.faces.component.EditableValueHolder
Returns:
the new valid value

setValid

public final void setValid(boolean valid)
Sets whether the component's value is currently valid

Specified by:
setValid in interface javax.faces.component.EditableValueHolder
Parameters:
valid - the new valid value

isRequired

public final boolean isRequired()
Gets whether a non-null, non-empty value must be entered. If false, validators will not be executed when the value is null or empty.

Specified by:
isRequired in interface javax.faces.component.EditableValueHolder
Returns:
the new required value

setRequired

public final void setRequired(boolean required)
Sets whether a non-null, non-empty value must be entered. If false, validators will not be executed when the value is null or empty.

Specified by:
setRequired in interface javax.faces.component.EditableValueHolder
Parameters:
required - the new required value

isLocalValueSet

public final boolean isLocalValueSet()
Gets whether a local value is currently set. If false, values are being retrieved from any attached ValueBinding

Specified by:
isLocalValueSet in interface javax.faces.component.EditableValueHolder
Returns:
the new localValueSet value

setLocalValueSet

public final void setLocalValueSet(boolean localValueSet)
Sets whether a local value is currently set. If false, values are being retrieved from any attached ValueBinding

Specified by:
setLocalValueSet in interface javax.faces.component.EditableValueHolder
Parameters:
localValueSet - the new localValueSet value

getSubmittedValue

public final java.lang.Object getSubmittedValue()
Gets the current submitted value. This value, if non-null, is set by the Renderer to store a possibly invalid value for later conversion or redisplay, and has not yet been converted into the proper type for this component instance. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer; however, user code may manually set it to null to erase any submitted value.

Specified by:
getSubmittedValue in interface javax.faces.component.EditableValueHolder
Returns:
the new submittedValue value

setSubmittedValue

public final void setSubmittedValue(java.lang.Object submittedValue)
Sets the current submitted value. This value, if non-null, is set by the Renderer to store a possibly invalid value for later conversion or redisplay, and has not yet been converted into the proper type for this component instance. This method should only be used by the decode() and validate() method of this component, or its corresponding Renderer; however, user code may manually set it to null to erase any submitted value.

Specified by:
setSubmittedValue in interface javax.faces.component.EditableValueHolder
Parameters:
submittedValue - the new submittedValue value

getValidator

public final javax.faces.el.MethodBinding getValidator()
Deprecated. 

Gets a method reference to a validator method

Specified by:
getValidator in interface javax.faces.component.EditableValueHolder
Returns:
the new validator value

setValidator

public final void setValidator(javax.faces.el.MethodBinding validator)
Deprecated. 

Sets a method reference to a validator method

Specified by:
setValidator in interface javax.faces.component.EditableValueHolder
Parameters:
validator - the new validator value

getValueChangeListener

public final javax.faces.el.MethodBinding getValueChangeListener()
Deprecated. 

Gets a method reference to an value change listener

Specified by:
getValueChangeListener in interface javax.faces.component.EditableValueHolder
Returns:
the new valueChangeListener value

setValueChangeListener

public final void setValueChangeListener(javax.faces.el.MethodBinding valueChangeListener)
Deprecated. 

Sets a method reference to an value change listener

Specified by:
setValueChangeListener in interface javax.faces.component.EditableValueHolder
Parameters:
valueChangeListener - the new valueChangeListener value

getRequiredMessageDetail

public final java.lang.String getRequiredMessageDetail()
Gets the message to be displayed, if 'required' validation fails.

Parameters:

Returns:
the new requiredMessageDetail value

setRequiredMessageDetail

public final void setRequiredMessageDetail(java.lang.String requiredMessageDetail)
Sets the message to be displayed, if 'required' validation fails.

Parameters:

Parameters:
requiredMessageDetail - the new requiredMessageDetail value

addValueChangeListener

public final void addValueChangeListener(javax.faces.event.ValueChangeListener listener)
Adds a valueChange listener.

Specified by:
addValueChangeListener in interface javax.faces.component.EditableValueHolder
Parameters:
listener - the valueChange listener to add

removeValueChangeListener

public final void removeValueChangeListener(javax.faces.event.ValueChangeListener listener)
Removes a valueChange listener.

Specified by:
removeValueChangeListener in interface javax.faces.component.EditableValueHolder
Parameters:
listener - the valueChange listener to remove

getValueChangeListeners

public final javax.faces.event.ValueChangeListener[] getValueChangeListeners()
Returns an array of attached valueChange listeners.

Specified by:
getValueChangeListeners in interface javax.faces.component.EditableValueHolder
Returns:
an array of attached valueChange listeners.

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class UIXValue

getBeanType

protected FacesBean.Type getBeanType()
Overrides:
getBeanType in class UIXValue


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.