org.alfresco.web.ui.common.component
Class UISelectList

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 org.alfresco.web.ui.common.component.UISelectList
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class UISelectList
extends javax.faces.component.UIInput
implements javax.faces.component.NamingContainer

The SelectList component displays a graphical list of items, each with a label and icon image. The list has three selection modes; single select (radio), multi-select (checkbox) and active selection mode (child action components). The value for the component is collection of UIListItem objects or a UIListItems instance. For passive single and multi-select modes, the selected value(s) can be retrieved from the component. For active selection mode, appropriate child components such as Command buttons or Action Links will be rendered for each item in the list, data-binding to the specified 'var' variable should be used to bind required params. It is then up to the developer to retrieve the selected item param from the actionListener of the appropriate child component.


Field Summary
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
UISelectList()
          Default constructor
 
Method Summary
 void broadcast(javax.faces.event.FacesEvent event)
          Override event broadcasting to look for event wrappers to set the current row context correctly for components that have been rendered multiple times in the list.
 void decode(javax.faces.context.FacesContext context)
           
 void encodeBegin(javax.faces.context.FacesContext context)
           
 void encodeChildren(javax.faces.context.FacesContext context)
           
 java.lang.String getClientId(javax.faces.context.FacesContext context)
           
 boolean getEscapeItemDescription()
          Get the escape item description flag
 boolean getEscapeItemLabel()
          Get the escape item label flag
 java.lang.String getFamily()
           
 boolean getRendersChildren()
           
 int getRowIndex()
           
 boolean isActiveSelect()
          Get the active selection mode flag
 boolean isMultiSelect()
          Get the multi-select rendering flag
 void processDecodes(javax.faces.context.FacesContext context)
          Override the processing of child component decodes - we set the current row context so any events queued by child components wrapped in FacesEventWrapper have current row value.
 void queueEvent(javax.faces.event.FacesEvent event)
          Override event queueing from child components - wrap and add current row value
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setActiveSelect(boolean activeSelect)
          Set true for active selection mode, false otherwise
 void setEscapeItemDescription(boolean escapeItemDescription)
          Set true to escape the items description, false otherwise
 void setEscapeItemLabel(boolean escapeItemLabel)
          Set true to escape the items label, false otherwise
 void setMultiSelect(boolean multiSelect)
          Set true for multi-select rendering, false otherwise
 void setRowIndex(int rowIndex)
          Set the transient current row index.
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, getConvertedValue, getSubmittedValue, getValidator, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
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

UISelectList

public UISelectList()
Default constructor

Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIInput
See Also:
UIComponent.getFamily()

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
See Also:
StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)

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
See Also:
StateHolder.saveState(javax.faces.context.FacesContext)

getClientId

public java.lang.String getClientId(javax.faces.context.FacesContext context)
Overrides:
getClientId in class javax.faces.component.UIComponentBase
Returns:
the client Id for this naming container component - based on the current row context. This allows a single component rendered multiple times in a list to dynamically base their ID on the current row - so that the 'correct' component is decoded and event is queued with the current row value.

processDecodes

public void processDecodes(javax.faces.context.FacesContext context)
Override the processing of child component decodes - we set the current row context so any events queued by child components wrapped in FacesEventWrapper have current row value.

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

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Override event queueing from child components - wrap and add current row value

Overrides:
queueEvent in class javax.faces.component.UIComponentBase

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Override event broadcasting to look for event wrappers to set the current row context correctly for components that have been rendered multiple times in the list.

Overrides:
broadcast in class javax.faces.component.UIInput
Throws:
javax.faces.event.AbortProcessingException

decode

public void decode(javax.faces.context.FacesContext context)
Overrides:
decode in class javax.faces.component.UIInput
See Also:
UIComponentBase.decode(javax.faces.context.FacesContext)

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
See Also:
UIComponentBase.encodeChildren(javax.faces.context.FacesContext)

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase
See Also:
UIComponentBase.getRendersChildren()

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
See Also:
UIComponentBase.encodeBegin(javax.faces.context.FacesContext)

getRowIndex

public int getRowIndex()
Returns:
current row index

setRowIndex

public void setRowIndex(int rowIndex)
Set the transient current row index. Setting this value causes all child components to have their ID values reset - so that cached clientID values are regenerated when next requested.

Parameters:
rowIndex -

isMultiSelect

public boolean isMultiSelect()
Get the multi-select rendering flag

Returns:
true for multi-select rendering, false otherwise

setMultiSelect

public void setMultiSelect(boolean multiSelect)
Set true for multi-select rendering, false otherwise

Parameters:
multiSelect - True for multi-select

isActiveSelect

public boolean isActiveSelect()
Get the active selection mode flag

Returns:
true for active selection mode, false otherwise

setActiveSelect

public void setActiveSelect(boolean activeSelect)
Set true for active selection mode, false otherwise

Parameters:
activeSelect - True for active selection

getEscapeItemLabel

public boolean getEscapeItemLabel()
Get the escape item label flag

Returns:
true if the items label should be escaped, false otherwise

setEscapeItemLabel

public void setEscapeItemLabel(boolean escapeItemLabel)
Set true to escape the items label, false otherwise

Parameters:
escapeItemLabel - true to escape the items label

getEscapeItemDescription

public boolean getEscapeItemDescription()
Get the escape item description flag

Returns:
true if the items description should be escaped, false otherwise

setEscapeItemDescription

public void setEscapeItemDescription(boolean escapeItemDescription)
Set true to escape the items description, false otherwise

Parameters:
escapeItemDescription - true to escape the items description


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.