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

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.sun.rave.web.ui.component.SelectorBase
                      extended by com.sun.rave.web.ui.component.Selector
                          extended by com.sun.rave.web.ui.component.ListSelectorBase
                              extended by com.sun.rave.web.ui.component.ListSelector
                                  extended by com.sun.rave.web.ui.component.DropDownBase
All Implemented Interfaces:
ComplexComponent, ListManager, SelectorManager, javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
DropDown

public abstract class DropDownBase
extends ListSelector

About this tag

This tag renders a drop-down menu. 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 dropdown tag

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.model.Option.

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

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

Facets

Client-side JavaScript functions

Examples

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

The dataBean backing bean would include the following definition for the "airports" items:

     private Option[] airports = null;
      // Creates a new instance of backing bean //
     public DataBean() {
         airports = new Option[11];
         airports[0] = new Option("SFO", "San Francisco");
         airports[1] = new Option("OAK", "Oakland");
         airports[2] = new Option("SAN", "San Diego");
         airports[3] = new Option("BOS", "Boston");
         airports[4] = new Option("ARN", "Stockholm");
         airports[5] = new Option("MNL", "Manila");
         airports[6] = new Option("CDG", "Paris");
         airports[7] = new Option("PDX", "Portland");
         airports[8] = new Option("LAX", "Los Angeles");
         airports[9] = new Option("NRT", "Tokyo");
         airports[10] = new Option("TBD", "Future Airport");
         airports[10].setDisabled(true);
     }
     public Option[] getAirports() {
         return airports;
     }
 

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, UPDATE_MESSAGE_ID
 
Fields inherited from class javax.faces.component.UIComponent
bindings
 
Constructor Summary
DropDownBase()
          Construct a new DropDownBase.
 
Method Summary
 javax.faces.el.MethodBinding getAction()
          Method binding representing a method that processes application actions from this component.
 javax.faces.el.MethodBinding getActionListener()
          Method binding representing a method that receives action from this, and possibly other, components.
 java.lang.String getFamily()
          Return the identifier of the component family to which this component belongs.
 boolean isForgetValue()
          If this flag is set to true, then the component is always rendered with no initial selection.
 boolean isNavigateToValue()
          If this flag is set to true, then selecting an item from this component will cause the application to navigate using the DropDown's value as the action.
 boolean isSubmitForm()
          Flag indicating that the form should be submitted when the value of the component changes.
 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 setAction(javax.faces.el.MethodBinding action)
          Method binding representing a method that processes application actions from this component.
 void setActionListener(javax.faces.el.MethodBinding actionListener)
          Method binding representing a method that receives action from this, and possibly other, components.
 void setForgetValue(boolean forgetValue)
          If this flag is set to true, then the component is always rendered with no initial selection.
 void setNavigateToValue(boolean navigateToValue)
          If this flag is set to true, then selecting an item from this component will cause the application to navigate using the DropDown's value as the action.
 void setSubmitForm(boolean submitForm)
          Flag indicating that the form should be submitted when the value of the component changes.
 
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, isMultiple, setMultiple, 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, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, 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, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
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, isMultiple, isReadOnly
 

Constructor Detail

DropDownBase

public DropDownBase()

Construct a new DropDownBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance.

Overrides:
getFamily in class ListSelectorBase

getAction

public javax.faces.el.MethodBinding getAction()

Method binding representing a method that processes application actions from this component. This attribute is only referenced when submitForm is true.


setAction

public void setAction(javax.faces.el.MethodBinding action)

Method binding representing a method that processes application actions from this component. This attribute is only referenced when submitForm is true.

See Also:
getAction()

getActionListener

public javax.faces.el.MethodBinding getActionListener()

Method binding representing a method that receives action from this, and possibly other, components. The Action Listener is invoked only when submitForm is true.


setActionListener

public void setActionListener(javax.faces.el.MethodBinding actionListener)

Method binding representing a method that receives action from this, and possibly other, components. The Action Listener is invoked only when submitForm is true.

See Also:
getActionListener()

isForgetValue

public boolean isForgetValue()

If this flag is set to true, then the component is always rendered with no initial selection.


setForgetValue

public void setForgetValue(boolean forgetValue)

If this flag is set to true, then the component is always rendered with no initial selection.

See Also:
isForgetValue()

isNavigateToValue

public boolean isNavigateToValue()

If this flag is set to true, then selecting an item from this component will cause the application to navigate using the DropDown's value as the action. Use this in place of defining the navigation outcome using the action MethodBinding. This applies only if submitForm is true.


setNavigateToValue

public void setNavigateToValue(boolean navigateToValue)

If this flag is set to true, then selecting an item from this component will cause the application to navigate using the DropDown's value as the action. Use this in place of defining the navigation outcome using the action MethodBinding. This applies only if submitForm is true.

See Also:
isNavigateToValue()

isSubmitForm

public boolean isSubmitForm()

Flag indicating that the form should be submitted when the value of the component changes.


setSubmitForm

public void setSubmitForm(boolean submitForm)

Flag indicating that the form should be submitted when the value of the component changes.

See Also:
isSubmitForm()

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