com.ibm.xsp.component
Class UITypeAhead

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by com.ibm.xsp.component.UITypeAhead
All Implemented Interfaces:
FacesAjaxComponent, FacesOutputFiltering, FacesDojoComponent, javax.faces.component.StateHolder
Direct Known Subclasses:
XspTypeAhead

public class UITypeAhead
extends javax.faces.component.UIComponentBase
implements FacesDojoComponent, FacesAjaxComponent, FacesOutputFiltering

Abstract AJAX type ahead control for an existing input text.

This abstract control takes care of processing the values to be returned to the client based on the values entered by the user. The concrete control that extends this is the ajaxTypeAhead control.

Not 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
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
static java.lang.String PARENT_RENDERER_TYPE
           
static java.lang.String RENDERER_TYPE
           
static java.lang.String VALUE_NAME
          The name of the request parameter containing the value typed in so far in the typeAhead, available when processing an ajax request from the client-side typeAhead.
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Constructor Summary
UITypeAhead()
           
 
Method Summary
 void addDojoAttribute(DojoAttribute attribute)
          Add a dojo attribute to the set associated with this property.
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeChildren(javax.faces.context.FacesContext context)
           
 void encodeEnd(javax.faces.context.FacesContext context)
           
 java.lang.String getDefaultHtmlFilter()
           
 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 getFamily()
           
 java.lang.String getHtmlFilter()
           Return the value of the htmlFilter property.
 java.lang.String getHtmlFilterName()
          Look for an html filtering engine associated to the control.
 int getMaxValues()
           Return the value of the maxValues property.
 java.lang.String getParentRendererType()
           
 java.lang.Object getValueList()
           Return the value of the valueList property.
 java.lang.String getValueListSeparator()
           Return the value of the valueListSeparator property.
 java.lang.String getVar()
          Returns the var value used by children to reference the data associated with this component.
 boolean handles(javax.faces.context.FacesContext context)
          Check if the pathinfo request is for this target ajax component
protected  boolean isChangeParentRenderer()
          Available to override in subclasses, used to determine whether to change the parent control's renderer-type.
 boolean isIgnoreCase()
           Return the value of the ignoreCase property.
 boolean isPreventFiltering()
           Return the value of the preventFiltering property.
 boolean isReadonly()
           
 boolean isTypeAheadEnabled(javax.faces.context.FacesContext context)
           
 boolean isValueMarkup()
           Return the value of the valueMarkup property.
protected  boolean match(java.lang.String value, java.lang.String starts, boolean ignoreCase)
          Helper method which indicates if the value matches that of the starts value, optionally ignoring case.
 void processAjaxRequest(javax.faces.context.FacesContext context)
          Process the request for this target ajax component
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 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 setHtmlFilter(java.lang.String htmlFilter)
           Set the value of the htmlFilter property.
 void setIgnoreCase(boolean ignoreCase)
           Set the value of the ignoreCase property.
 void setMaxValues(int maxValues)
           Set the value of the maxValues property.
 void setParent(javax.faces.component.UIComponent parent)
           
 void setParentRendererType(java.lang.String parentRendererType)
           
 void setPreventFiltering(boolean preventFiltering)
           Set the value of the ignoreCase property.
 void setValueList(java.lang.Object valueList)
           Set the value of the valueList property.
 void setValueListSeparator(java.lang.String valueListSeparator)
           Set the value of the valueListSeparator property.
 void setValueMarkup(boolean valueMarkup)
           Set the value of the valueMarkup property.
 void setVar(java.lang.String var)
          Returns the var value.
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspCleanTransientData, _xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, broadcast, decode, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, 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
 

Field Detail

RENDERER_TYPE

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

PARENT_RENDERER_TYPE

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

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

VALUE_NAME

public static final java.lang.String VALUE_NAME
The name of the request parameter containing the value typed in so far in the typeAhead, available when processing an ajax request from the client-side typeAhead.

See Also:
Constant Field Values
Constructor Detail

UITypeAhead

public UITypeAhead()
Method Detail

setParent

public void setParent(javax.faces.component.UIComponent parent)
Overrides:
setParent in class javax.faces.component.UIComponentBase

isChangeParentRenderer

protected boolean isChangeParentRenderer()
Available to override in subclasses, used to determine whether to change the parent control's renderer-type.


getDefaultHtmlFilter

public java.lang.String getDefaultHtmlFilter()

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:

getFamily

public java.lang.String getFamily()
Specified by:
getFamily in class javax.faces.component.UIComponent

getVar

public java.lang.String getVar()
Returns the var value used by children to reference the data associated with this component.

Returns:
the var

setVar

public void setVar(java.lang.String var)
Returns the var value.

Parameters:
var - the var to set

getMaxValues

public int getMaxValues()

Return the value of the maxValues property. Contents:

Indicates the maximum number of selections to display in the drop down list


getValueList

public java.lang.Object getValueList()

Return the value of the valueList property. Contents:

The list of values returned to the client. In case of markup, then it should return a n HTML list (see bellow). Else, it assumes a list of string values which can be one of: a) Java array/collection toString() is applied to each entry in order to compose the result. b) A string value It splits the string using a separator (valueListSeparator). c) A javascript value (FBSScript) Treat it as either a string or a collection.


getValueListSeparator

public java.lang.String getValueListSeparator()

Return the value of the valueListSeparator property. Contents:

The separator to use in case of strings.


isIgnoreCase

public boolean isIgnoreCase()

Return the value of the ignoreCase property. Contents:

Indicate if the search should ignore the character case.


isPreventFiltering

public boolean isPreventFiltering()

Return the value of the preventFiltering property.

Indicate if the list of values should be filtered with the value sent by the browser.


isValueMarkup

public boolean isValueMarkup()

Return the value of the valueMarkup property. Contents:

Indicate if value list contains a whole XML markup fragment or simply a list.


match

protected boolean match(java.lang.String value,
                        java.lang.String starts,
                        boolean ignoreCase)
Helper method which indicates if the value matches that of the starts value, optionally ignoring case.

Parameters:
value -
starts -
ignoreCase -
Returns:

handles

public boolean handles(javax.faces.context.FacesContext context)
Description copied from interface: FacesAjaxComponent
Check if the pathinfo request is for this target ajax component

Specified by:
handles in interface FacesAjaxComponent
Returns:
true if request handler

processAjaxRequest

public void processAjaxRequest(javax.faces.context.FacesContext context)
                        throws java.io.IOException
Description copied from interface: FacesAjaxComponent
Process the request for this target ajax component

Specified by:
processAjaxRequest in interface FacesAjaxComponent
Throws:
java.io.IOException

setIgnoreCase

public void setIgnoreCase(boolean ignoreCase)

Set the value of the ignoreCase property.


setPreventFiltering

public void setPreventFiltering(boolean preventFiltering)

Set the value of the ignoreCase property.


setMaxValues

public void setMaxValues(int maxValues)

Set the value of the maxValues property.


setValueList

public void setValueList(java.lang.Object valueList)

Set the value of the valueList property.


setValueListSeparator

public void setValueListSeparator(java.lang.String valueListSeparator)

Set the value of the valueListSeparator property.


setValueMarkup

public void setValueMarkup(boolean valueMarkup)

Set the value of the valueMarkup property.


getHtmlFilter

public java.lang.String getHtmlFilter()

Return the value of the htmlFilter property. Contents:

Property indicating which Active Content Filtering processor should be used when data is emitted.


setHtmlFilter

public void setHtmlFilter(java.lang.String htmlFilter)

Set the value of the htmlFilter property.


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

setDojoType

public void setDojoType(java.lang.String dojoType)

Set the value of the dojoType property.


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

addDojoAttribute

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

Parameters:
action -

setDojoAttributes

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

Set the value of the dojoAttributes property.


encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context)
                    throws java.io.IOException
Overrides:
encodeChildren in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context)
               throws java.io.IOException
Overrides:
encodeEnd in class javax.faces.component.UIComponentBase
Throws:
java.io.IOException

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

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

getParentRendererType

public java.lang.String getParentRendererType()
Returns:
the parentRendererType

setParentRendererType

public void setParentRendererType(java.lang.String parentRendererType)
Parameters:
parentRendererType - the parentRendererType to set

isTypeAheadEnabled

public boolean isTypeAheadEnabled(javax.faces.context.FacesContext context)

isReadonly

public boolean isReadonly()