com.ibm.xsp.component
Class UIInputEx

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by com.ibm.xsp.component.UIInputEx
All Implemented Interfaces:
FacesComponent, FacesInputComponent, FacesInputFiltering, FacesOutputFiltering, FacesDojoComponent, ThemeControl, javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
UIInputCheckbox, UIInputHidden, UIInputRadio, UIInputRichText, UIInputText, UIInputTextarea

public class UIInputEx
extends javax.faces.component.UIInput
implements ThemeControl, FacesInputComponent, FacesInputFiltering, FacesDojoComponent, FacesComponent

The input control base implementation, that is intended to be subclassed.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponentBase
javax.faces.component.UIComponentBase.AggregatedIterator, javax.faces.component.UIComponentBase.UnmodifiableIterator
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponent
javax.faces.component.UIComponent.StateMap, javax.faces.component.UIComponent.StateMapEntry
 
Field Summary
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Constructor Summary
UIInputEx()
           
 
Method Summary
 void addDojoAttribute(DojoAttribute attribute)
          Add a dojo attribute to the set associated with this property.
 void buildContents(javax.faces.context.FacesContext context, FacesComponentBuilder builder)
          Build the component children and facets, the default implementation is usually:
builder.buildAll(context, this, true); // includeFacets=true
protected  java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, java.lang.Object newSubmittedValue)
           
 java.lang.String getDefaultHtmlFilter()
          The name of the html filtering engine to use when the "htmlFilter" property is not set in the XPage source.
 java.lang.String getDefaultHtmlFilterIn()
          The name of the html filtering engine to use when the "htmlFilterIn" property is not set in the XPage source.
 java.lang.Object getDefaultValue()
           Return the default value of this control.
 java.util.List<DojoAttribute> getDojoAttributes()
           Return the value of the dojoAttributes property.
 java.lang.String getDojoType()
           Return the value of the dojoType property.
 java.lang.String getHtmlFilter()
          In some subclasses this is overridden with a property indicating which Active Content Filtering processor should be used when data is emitted.
 java.lang.String getHtmlFilterIn()
          In some subclasses this is overridden with a property indicating which Active Content Filtering processor should be used when data is uploaded.
 java.lang.String getHtmlFilterInName()
          Look for an html filtering engine (in) associated to the control.
 java.lang.String getHtmlFilterName()
          Look for an html filtering engine associated to the control.
 java.lang.String getMultipleSeparator()
          Indicates that this control is bound to multiple values and provides the delimiter used to separate them
 javax.faces.component.UIComponent getRendererComponent()
           
 java.lang.String getRequiredMessage()
          The error message to display, in the client or in a Display Error control, when field is required and a value is not present.
 java.lang.String getStyleKitFamily()
          The styleKitFamily is basically the default themeId, to use if the "themeId" property is not set on this control instance in the XPage source.
 java.lang.Object getValue()
          Like the superclass implementation, except may use the default value ( getDefaultValue()).
 java.util.List<?> getValueAsList()
          Get the current value as a List, used as a programmability API in Server Side Java Script when getMultipleSeparator() is set.
 java.lang.String getValueAsString()
          Get the current value as a String.
 void initAfterContents(javax.faces.context.FacesContext context)
          Perform component initialization after it's children and facets are added.
 void initBeforeContents(javax.faces.context.FacesContext context)
          Perform component initialization before its children and facets are added.
 boolean isDisableClientSideValidation()
          Check if client side validation is disabled.
 boolean isDisableModifiedFlag()
          The modified support is the mechanism in the Notes Client where if an input control contains a value and the user closes the XPage tab, they will be prompted like: The XPage has been modified, Save, Discard, Cancel? As part of that mechanism, each input control has a "disableModifiedFlag" property to allow that control to opt-out of the modified support, so for example if you have a search field, where you don't normally save the searched text to a document, you would exclude that search field from the modified support, so a value in that search field will not cause the Save/Discard dialog to appear.
 boolean isDisableValidators()
          Check if the validators should be disabled for this control.
 boolean isMultipleTrim()
          This is true by default, so when multipleSeparator is set it will trim the separated values, so that leading and trailing whitespace is removed.
 boolean isRequired()
          Like the superclass implementation but also the presence of a FacesRequiredValidator when the required property is not explicitly set indicates that the field is required.
 boolean isShowReadonlyAsDisabled()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setDefaultValue(java.lang.Object defaultValue)
           Set the default value for this control.
 void setDisableClientSideValidation(boolean disableClientSideValidation)
           
 void setDisableModifiedFlag(boolean disableModifiedFlag)
           
 void setDisableValidators(boolean disableValidators)
           
 void setDojoAttributes(java.util.List<DojoAttribute> dojoAttributes)
           Set the value of the dojoAttributes property.
 void setDojoType(java.lang.String dojoType)
           Set the value of the dojoType property.
 void setMultipleSeparator(java.lang.String multipleSeparator)
           
 void setMultipleTrim(boolean multipleTrim)
           
 void setRendererComponent(javax.faces.component.UIComponent rendererComponent)
          This is invoked by the Type Ahead control and the Date Time Picker control.
 void setRequired(boolean required)
           
 void setShowReadonlyAsDisabled(boolean showReadonlyAsDisabled)
           
 void setValueFromString(java.lang.String value)
          Create a list based on a string.
 void updateModel(javax.faces.context.FacesContext context)
           
protected  void validateItemValue(javax.faces.context.FacesContext context, java.lang.Object newValue)
          Invoked by validateValue(FacesContext, Object) when !isDisableValidators.
protected  void validateValue(javax.faces.context.FacesContext context, java.lang.Object newValue)
           
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getFamily, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isEmpty, isImmediate, isLocalValueSet, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, validate
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspCleanTransientData, _xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
_xspGetStateId, _xspGetStateMap, _xspRestoreAttribute, _xspRestoreState, _xspSaveState, invokeOnComponent, isVisitable, markInitialState, setControlState, visitTree
 
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, setConverter
 

Constructor Detail

UIInputEx

public UIInputEx()
Method Detail

getRendererComponent

public javax.faces.component.UIComponent getRendererComponent()
Returns:
See Also:
setRendererComponent(UIComponent)

setRendererComponent

public void setRendererComponent(javax.faces.component.UIComponent rendererComponent)
This is invoked by the Type Ahead control and the Date Time Picker control. Those controls designate themselves as the renderer component for their parent edit box control, and change their parent's renderer type to a different renderer that knows how to output both the edit box and the renderer-component child. The renderer component is used in getStyleKitFamily(), where it is used as a delegate to supply the styleKitFamily.

Parameters:
rendererComponent -

getStyleKitFamily

public java.lang.String getStyleKitFamily()
Description copied from interface: ThemeControl
The styleKitFamily is basically the default themeId, to use if the "themeId" property is not set on this control instance in the XPage source. For example, "InputField.EditBox" is used for most Edit Box controls. See Domino/xsp/nsf/themes/webstandard.theme for more examples.

The implementation may return different values depending on the configuration of the current control, for example the Button control returns a different value and looks different when it is configured as a cancel button.

Specified by:
getStyleKitFamily in interface ThemeControl
Returns:
a non-null themeId corresponding to the configuration for this type of control in a theme file.
See Also:
ThemeControl.getStyleKitFamily()

getDefaultHtmlFilter

public java.lang.String getDefaultHtmlFilter()
The name of the html filtering engine to use when the "htmlFilter" property is not set in the XPage source. This UIInputEx implementation defaults to null, but subclasses may provide a default filter for their control type.

Returns:
null or the name of the default output filter to use when the "htmlFilter" property is not set in the XPage source.
See Also:
FacesOutputFiltering.getHtmlFilterName()

getHtmlFilterName

public java.lang.String getHtmlFilterName()
Description copied from interface: FacesOutputFiltering
Look for an html filtering engine associated to the control.

Specified by:
getHtmlFilterName in interface FacesOutputFiltering
Returns:
See Also:
FacesOutputFiltering.getHtmlFilterName()

getDefaultHtmlFilterIn

public java.lang.String getDefaultHtmlFilterIn()
The name of the html filtering engine to use when the "htmlFilterIn" property is not set in the XPage source. This UIInputEx implementation defaults to null, but subclasses may provide a default filter for their control type.

Returns:
null or the name of the default input filter to use when the "htmlFilterIn" property is not set in the XPage source.
See Also:
FacesInputFiltering.getHtmlFilterInName()

getHtmlFilterInName

public java.lang.String getHtmlFilterInName()
Description copied from interface: FacesInputFiltering
Look for an html filtering engine (in) associated to the control.

Specified by:
getHtmlFilterInName in interface FacesInputFiltering
Returns:
See Also:
FacesInputFiltering.getHtmlFilterInName()

setDefaultValue

public void setDefaultValue(java.lang.Object defaultValue)

Set the default value for this control.


getDefaultValue

public java.lang.Object getDefaultValue()

Return the default value of this control. This is an object, not a String, the converter is not applied to the value, so if you need to set an int or Date as the default value, you will need to compute the value as the correct type, rather than typing it directly into the property in the XPage as a String. The object should be serializable or computed, to prevent errors when persistence is enabled.


isDisableClientSideValidation

public boolean isDisableClientSideValidation()
Description copied from interface: FacesInputComponent
Check if client side validation is disabled.

Specified by:
isDisableClientSideValidation in interface FacesInputComponent
Returns:

setDisableClientSideValidation

public void setDisableClientSideValidation(boolean disableClientSideValidation)

isDisableValidators

public boolean isDisableValidators()
Description copied from interface: FacesInputComponent
Check if the validators should be disabled for this control.

Specified by:
isDisableValidators in interface FacesInputComponent
Returns:

setDisableValidators

public void setDisableValidators(boolean disableValidators)

isShowReadonlyAsDisabled

public boolean isShowReadonlyAsDisabled()

setShowReadonlyAsDisabled

public void setShowReadonlyAsDisabled(boolean showReadonlyAsDisabled)

isMultipleTrim

public boolean isMultipleTrim()
This is true by default, so when multipleSeparator is set it will trim the separated values, so that leading and trailing whitespace is removed.

Returns:

setMultipleTrim

public void setMultipleTrim(boolean multipleTrim)

isDisableModifiedFlag

public boolean isDisableModifiedFlag()
Description copied from interface: FacesInputComponent
The modified support is the mechanism in the Notes Client where if an input control contains a value and the user closes the XPage tab, they will be prompted like: The XPage has been modified, Save, Discard, Cancel? As part of that mechanism, each input control has a "disableModifiedFlag" property to allow that control to opt-out of the modified support, so for example if you have a search field, where you don't normally save the searched text to a document, you would exclude that search field from the modified support, so a value in that search field will not cause the Save/Discard dialog to appear. This method checks the value of that input control property in the XPage, and also, if the value is not set for the individual input control, checks the property on the XPage root control UIViewRootEx.isEnableModifiedFlag().

Specified by:
isDisableModifiedFlag in interface FacesInputComponent
Returns:

setDisableModifiedFlag

public void setDisableModifiedFlag(boolean disableModifiedFlag)

getMultipleSeparator

public java.lang.String getMultipleSeparator()
Indicates that this control is bound to multiple values and provides the delimiter used to separate them


setMultipleSeparator

public void setMultipleSeparator(java.lang.String multipleSeparator)

getValue

public java.lang.Object getValue()
Like the superclass implementation, except may use the default value ( getDefaultValue()).

Specified by:
getValue in interface javax.faces.component.ValueHolder
Overrides:
getValue in class javax.faces.component.UIOutput
See Also:
UIOutput.getValue()

getValueAsList

public java.util.List<?> getValueAsList()
Get the current value as a List, used as a programmability API in Server Side Java Script when getMultipleSeparator() is set. When the multipleSeparator is set, the value is mostly returned as a list, unless there is a single item, in which case the single item value is returned. This method ensures that the returned value is a list (or null) even though the input doesn't handle multiple values.

Returns:
the list of values, or null

getValueAsString

public java.lang.String getValueAsString()
Get the current value as a String. This method converts the value by using the associated converter. In case of a multiple value input text, then each value is converted separately and separated with the associated separator.

Returns:
the values as a string, or null

setValueFromString

public void setValueFromString(java.lang.String value)
Create a list based on a string. The string is converted to the actual value expected by the text box, using the converter. If the input text handles multiple values, then the split is split into its different values and each value is converted separately.


setRequired

public void setRequired(boolean required)
Specified by:
setRequired in interface javax.faces.component.EditableValueHolder
Overrides:
setRequired in class javax.faces.component.UIInput

isRequired

public boolean isRequired()
Like the superclass implementation but also the presence of a FacesRequiredValidator when the required property is not explicitly set indicates that the field is required.

Specified by:
isRequired in interface javax.faces.component.EditableValueHolder
Overrides:
isRequired in class javax.faces.component.UIInput

getRequiredMessage

public java.lang.String getRequiredMessage()
The error message to display, in the client or in a Display Error control, when field is required and a value is not present. Delegates to a FacesRequiredValidator, or uses the default message.

Overrides:
getRequiredMessage in class javax.faces.component.UIInput

getConvertedValue

protected java.lang.Object getConvertedValue(javax.faces.context.FacesContext context,
                                             java.lang.Object newSubmittedValue)
                                      throws javax.faces.convert.ConverterException
Overrides:
getConvertedValue in class javax.faces.component.UIInput
Throws:
javax.faces.convert.ConverterException

validateValue

protected void validateValue(javax.faces.context.FacesContext context,
                             java.lang.Object newValue)
Overrides:
validateValue in class javax.faces.component.UIInput

validateItemValue

protected void validateItemValue(javax.faces.context.FacesContext context,
                                 java.lang.Object newValue)
Invoked by validateValue(FacesContext, Object) when !isDisableValidators. The newValue has already been converted if a Converter is present.


updateModel

public void updateModel(javax.faces.context.FacesContext context)
Overrides:
updateModel in class javax.faces.component.UIInput

getHtmlFilter

public java.lang.String getHtmlFilter()
In some subclasses this is overridden with a property indicating which Active Content Filtering processor should be used when data is emitted.


getHtmlFilterIn

public java.lang.String getHtmlFilterIn()
In some subclasses this is overridden with a property indicating which Active Content Filtering processor should be used when data is uploaded.


getDojoType

public java.lang.String getDojoType()

Return the value of the dojoType property. Contents:

Sets the default Dojo Type used to create this control in the browser.

Specified by:
getDojoType in interface FacesDojoComponent
See Also:
FacesDojoComponent

setDojoType

public void setDojoType(java.lang.String dojoType)

Set the value of the dojoType property.

See Also:
FacesDojoComponent

getDojoAttributes

public java.util.List<DojoAttribute> getDojoAttributes()

Return the value of the dojoAttributes property. Contents:

A list of Dojo attributes

Specified by:
getDojoAttributes in interface FacesDojoComponent
See Also:
FacesDojoComponent

addDojoAttribute

public void addDojoAttribute(DojoAttribute attribute)
Add a dojo attribute to the set associated with this property.

Parameters:
attribute -
See Also:
FacesDojoComponent

setDojoAttributes

public void setDojoAttributes(java.util.List<DojoAttribute> dojoAttributes)

Set the value of the dojoAttributes property.

See Also:
FacesDojoComponent

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class javax.faces.component.UIInput

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class javax.faces.component.UIInput

initBeforeContents

public void initBeforeContents(javax.faces.context.FacesContext context)
                        throws javax.faces.FacesException
Description copied from interface: FacesComponent
Perform component initialization before its children and facets are added.

Specified by:
initBeforeContents in interface FacesComponent
Throws:
javax.faces.FacesException

buildContents

public void buildContents(javax.faces.context.FacesContext context,
                          FacesComponentBuilder builder)
                   throws javax.faces.FacesException
Description copied from interface: FacesComponent
Build the component children and facets, the default implementation is usually:
builder.buildAll(context, this, true); // includeFacets=true

Specified by:
buildContents in interface FacesComponent
Throws:
javax.faces.FacesException

initAfterContents

public void initAfterContents(javax.faces.context.FacesContext context)
                       throws javax.faces.FacesException
Description copied from interface: FacesComponent
Perform component initialization after it's children and facets are added.

Specified by:
initAfterContents in interface FacesComponent
Throws:
javax.faces.FacesException