com.sun.rave.web.ui.component
Class ListboxBase

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byjavax.faces.component.UIInput
                  extended bycom.sun.rave.web.ui.component.SelectorBase
                      extended bycom.sun.rave.web.ui.component.Selector
                          extended bycom.sun.rave.web.ui.component.ListSelectorBase
                              extended bycom.sun.rave.web.ui.component.ListSelector
                                  extended bycom.sun.rave.web.ui.component.ListboxBase
All Implemented Interfaces:
ComplexComponent, javax.faces.component.EditableValueHolder, ListManager, SelectorManager, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
Listbox

public abstract class ListboxBase
extends ListSelector

About this tag

This tag renders a listbox. Use the selected attribute to associate the component with a model object that represents the current choice, by setting the value to an EL expression that corresponds to a property of a managed bean.

Configuring the listbox tag

Use the multiple attribute to specify whether the component accepts multiple selections. By default this is set to false. If multiple selections are allowed, the model object property must be either an array of primitives, an array of objects, or a (subclass of) java.util.List.

Use the items attribute to specify the options from which the web application user can choose. The value must be an EL expression that identifies an array, a java.util.Collection or a java.util.Map of com.sun.rave.web.ui.Option.

The first time the component is rendered, the options which correspond to the value of the selected model object property is marked as selected, using the equals method on the model object.

The number of list items simultaneously shown can be specified using the rows attribute, and the component will be rendered using a monospaced font if the useMonospace attribute is set to true.

To optionally specify a label for the component, use the label attribute, or specify a label facet.

Facets

Client-side JavaScript functions

Examples

 
     <ui:listbox selected="#{flightSearch.leaveAirport}" 
                  items="#{dataBean.airports}" 
                  rows="6"
                  id="leaveAirport" 
                  toolTip="#{msgs.chooseAirport}"
                  label="#{msgs.chooseDepartureAirport)" />
 
     <ui:listbox selected="#{flightSearch.leaveAirport}" 
                  items="#{dataBean.airports}" 
                  rows="6"
  	         id="leaveAirport" 
                  toolTip="#{msgs.chooseAirport}"
                  label="#{msgs.chooseDepartureAirport)" >
         <f:facet name="label">
             <facet component goes here>
         </f:facet>
     </ui:listbox>
 

Auto-generated component class. Do NOT modify; all changes will be lost!


Field Summary
 
Fields inherited from class com.sun.rave.web.ui.component.ListSelector
LIST_ID, listItems, VALUE_ID
 
Fields inherited from class com.sun.rave.web.ui.component.Selector
valueTypeEvaluator
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
ListboxBase()
          Construct a new ListboxBase.
 
Method Summary
 java.lang.String getFamily()
          Return the family for this component.
 boolean isMonospace()
          A property which indicates whether monospaced fonts should be used.
 boolean isMultiple()
          Flag indicating that the application user may make select more than one option from the listbox .
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setMonospace(boolean monospace)
          A property which indicates whether monospaced fonts should be used.
 void setMultiple(boolean multiple)
          Flag indicating that the application user may make select more than one option from the listbox .
 
Methods inherited from class com.sun.rave.web.ui.component.ListSelector
checkSelectionModel, createListItem, getLabelComponent, getListItems, getListItems, getOptions, getPrimaryElementID, getReadOnlyValueComponent, getSeparatorLength, getValueAsReadOnly, getValueAsStringArray, mainListSubmits, markSelectedListItems, processOptions, processSelections
 
Methods inherited from class com.sun.rave.web.ui.component.ListSelectorBase
getRows, isLabelOnTop, isSeparators, isVisible, setLabelOnTop, setRows, setSeparators, setVisible
 
Methods inherited from class com.sun.rave.web.ui.component.Selector
compareValues, getConvertedValue, getLabelLevel, getRendersChildren, getValueAsReadOnly, setSelected, toString
 
Methods inherited from class com.sun.rave.web.ui.component.SelectorBase
getItems, getLabel, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getSelected, getStyle, getStyleClass, getTabIndex, getToolTip, getValueBinding, isDisabled, isReadOnly, setDisabled, setItems, setLabel, setLabelLevel, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setStyle, setStyleClass, setTabIndex, setToolTip, setValueBinding
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, decode, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, 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, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.rave.web.ui.component.ListManager
getRows, getToolTip, isVisible
 
Methods inherited from interface javax.faces.component.EditableValueHolder
addValidator, addValueChangeListener, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValueChangeListener
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter, setValue
 
Methods inherited from interface com.sun.rave.web.ui.component.SelectorManager
getClientId, getOnChange, getStyle, getStyleClass, getTabIndex, isDisabled, isReadOnly
 

Constructor Detail

ListboxBase

public ListboxBase()

Construct a new ListboxBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class ListSelectorBase

isMonospace

public boolean isMonospace()

A property which indicates whether monospaced fonts should be used.


setMonospace

public void setMonospace(boolean monospace)

A property which indicates whether monospaced fonts should be used.

See Also:
isMonospace()

isMultiple

public boolean isMultiple()

Flag indicating that the application user may make select more than one option from the listbox .

Specified by:
isMultiple in interface SelectorManager
Overrides:
isMultiple in class Selector
Returns:
Value of property multiple.

setMultiple

public void setMultiple(boolean multiple)

Flag indicating that the application user may make select more than one option from the listbox .

Overrides:
setMultiple in class Selector
Parameters:
multiple - New value of property multiple.
See Also:
isMultiple()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class ListSelectorBase

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class ListSelectorBase