|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
com.sun.rave.web.ui.component.SelectorBase
com.sun.rave.web.ui.component.Selector
com.sun.rave.web.ui.component.ListSelectorBase
com.sun.rave.web.ui.component.ListSelector
com.sun.rave.web.ui.component.DropDownBase
public abstract class DropDownBase
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.
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.
label
: use this facet to specify a custom
component for the label.dropDown_setDisabled(<id>, <disabled>)
: use
this function to enable/disable the drop-down menu. <id>
must be the generated id of the component. Set
<disabled>
to true to disable the component,
false to enable it. dropDown_changed(<id>)
: this
function is automatically invoked by the drop-down menu's
onchange
handler. <id>
must be the generated id of the component.<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 |
---|
public DropDownBase()
Construct a new DropDownBase
.
Method Detail |
---|
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.
getFamily
in class ListSelectorBase
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.
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.
getAction()
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.
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.
getActionListener()
public boolean isForgetValue()
If this flag is set to true, then the component is always rendered with no initial selection.
public void setForgetValue(boolean forgetValue)
If this flag is set to true, then the component is always rendered with no initial selection.
isForgetValue()
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.
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.
isNavigateToValue()
public boolean isSubmitForm()
Flag indicating that the form should be submitted when the value of the component changes.
public void setSubmitForm(boolean submitForm)
Flag indicating that the form should be submitted when the value of the component changes.
isSubmitForm()
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class ListSelectorBase
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
saveState
in interface javax.faces.component.StateHolder
saveState
in class ListSelectorBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |