|
||||||||||
| 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.webui.jsf.component.WebuiInput
com.sun.webui.jsf.component.Selector
com.sun.webui.jsf.component.ListSelector
com.sun.webui.jsf.component.DropDown
public class DropDown
The DropDown component is used to display a drop down menu to allow users to select one or more items from a list.
| Field Summary | |
|---|---|
static java.lang.String |
SUBMIT
|
| Fields inherited from class com.sun.webui.jsf.component.ListSelector |
|---|
LABEL_FACET, LIST_ID, VALUE_ID, VALUE_LABEL_ID |
| Fields inherited from class javax.faces.component.UIInput |
|---|
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID |
| Fields inherited from interface javax.faces.component.NamingContainer |
|---|
SEPARATOR_CHAR |
| Constructor Summary | |
|---|---|
DropDown()
Default constructor. |
|
| Method Summary | |
|---|---|
void |
addActionListener(javax.faces.event.ActionListener listener)
Add a new ActionListener to the set of listeners interested
in being notified when ActionEvents occur. |
void |
broadcast(javax.faces.event.FacesEvent event)
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent)
processing, pass the ActionEvent being broadcast to the method
referenced by actionListener (if any), and to the default
ActionListener registered on the Application. |
javax.faces.el.MethodBinding |
getAction()
Deprecated. |
javax.el.MethodExpression |
getActionExpression()
Used to specify the action to take when this component is activated by the user. |
javax.faces.el.MethodBinding |
getActionListener()
Deprecated. |
javax.el.MethodExpression |
getActionListenerExpression()
The actionListenerExpression attribute is used to specify a method to handle an action event that is triggered when this component is activated by the user. |
javax.faces.event.ActionListener[] |
getActionListeners()
Return the set of registered ActionListeners for this
ActionSource2 instance. |
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getHtmlTemplate()
Get alternative HTML template to be used by this component. |
boolean |
getMultiple()
Getter for property multiple |
java.lang.String |
getOnSelect()
Scripting code executed when some text in this component value is selected. |
java.lang.String |
getRendererType()
|
int |
getRows()
The number of items to display, Integer.MIN_VALUE
is returned if no value has been set, or there is no value binding. |
java.lang.String |
getToolTip()
Sets the value of the title attribute for the HTML element. |
java.lang.Object |
getValue()
|
java.lang.String |
getWidth()
Return a value suitable for the CSS width property to be applied to an HTML select element or null. |
boolean |
isForgetValue()
If this flag is set to true, then the component is always rendered with no initial selection. |
boolean |
isLabelOnTop()
If true, the label is rendered above the component. |
boolean |
isNavigateToValue()
When this attribute is set to true, the value of the menu selection is used as the action, to determine which page is displayed next according to the registered navigation rules. |
boolean |
isReadOnly()
If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined. |
boolean |
isSubmitForm()
When the submitForm attribute is set to true, the form is immediately submitted when the user changes the selection in the drop down list. |
void |
processDecodes(javax.faces.context.FacesContext context)
The DropDown needs to override the standard decoding behaviour since it may also be an action source. |
void |
queueEvent(javax.faces.event.FacesEvent e)
Intercept queueEvent and, for ActionEvents, mark
the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES
if the immediate flag is true,
PhaseId.INVOKE_APPLICATION otherwise. |
void |
removeActionListener(javax.faces.event.ActionListener listener)
Remove an existing ActionListener (if any) from the set of
listeners interested in being notified when ActionEvents
occur. |
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)
Deprecated. |
void |
setActionExpression(javax.el.MethodExpression me)
The actionExpression attribute is used to specify the action to take when this component is activated by the user. |
void |
setActionListener(javax.faces.el.MethodBinding actionListener)
Deprecated. |
void |
setActionListenerExpression(javax.el.MethodExpression me)
The actionListenerExpression attribute is used to specify a method to handle an action event that is triggered when this component is activated by the user. |
void |
setForgetValue(boolean forgetValue)
If this flag is set to true, then the component is always rendered with no initial selection. |
void |
setHtmlTemplate(java.lang.String htmlTemplate)
Set alternative HTML template to be used by this component. |
void |
setLabelOnTop(boolean labelOnTop)
If true, the label is rendered above the component. |
void |
setMultiple(boolean multiple)
Setter for property multiple |
void |
setNavigateToValue(boolean navigateToValue)
When this attribute is set to true, the value of the menu selection is used as the action, to determine which page is displayed next according to the registered navigation rules. |
void |
setRows(int DisplayRows)
Setter for property Rows. |
void |
setSubmitForm(boolean submitForm)
When this attribute is set to true, the form is immediately submitted when the user changes the selection in the drop down list. |
void |
setToolTip(java.lang.String toolTip)
Sets the value of the title attribute for the HTML element. |
void |
validate(javax.faces.context.FacesContext context)
|
| Methods inherited from class com.sun.webui.jsf.component.ListSelector |
|---|
checkSelectionModel, getFocusElementId, getIndicatorComponent, getLabelComponent, getLabeledElementId, getListItems, getListItems, getPrimaryElementID, getReadOnlyValueComponent, getSeparatorLength, getValueAsReadOnly, getValueAsStringArray, isSeparators, isVisible, mainListSubmits, setSeparators, setVisible, setWidth |
| Methods inherited from class com.sun.webui.jsf.component.Selector |
|---|
getConvertedValue, getItems, getLabel, getLabelLevel, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getRendersChildren, getSelected, getStyle, getStyleClass, getTabIndex, getValueExpression, isDisabled, isMultiple, setDisabled, setItems, setLabel, setLabelLevel, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setSelected, setStyle, setStyleClass, setTabIndex, setValueExpression, toString |
| Methods inherited from class com.sun.webui.jsf.component.WebuiInput |
|---|
getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processUpdates, processValidators, setConverter, setId, setImmediate, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression |
| Methods inherited from class javax.faces.component.UIInput |
|---|
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel |
| Methods inherited from class javax.faces.component.UIOutput |
|---|
getConverter, getLocalValue |
| Methods inherited from class javax.faces.component.UIComponentBase |
|---|
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding |
| Methods inherited from class javax.faces.component.UIComponent |
|---|
encodeAll, getContainerClientId |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.faces.component.ActionSource |
|---|
isImmediate, setImmediate |
| 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, setConverter, setValue |
| Methods inherited from interface com.sun.webui.jsf.component.SelectorManager |
|---|
getClientId, getOnChange, getStyle, getStyleClass, getTabIndex, isDisabled, isMultiple |
| Field Detail |
|---|
public static final java.lang.String SUBMIT
| Constructor Detail |
|---|
public DropDown()
| Method Detail |
|---|
public java.lang.String getFamily()
Return the family for this component.
getFamily in class ListSelectorpublic java.lang.String getRendererType()
getRendererType in class javax.faces.component.UIComponentBasepublic java.lang.String getHtmlTemplate()
public void setHtmlTemplate(java.lang.String htmlTemplate)
public boolean getMultiple()
public void setMultiple(boolean multiple)
setMultiple in class Selectormultiple - New value of property multiplepublic void addActionListener(javax.faces.event.ActionListener listener)
Add a new ActionListener to the set of listeners interested
in being notified when ActionEvents occur.
addActionListener in interface javax.faces.component.ActionSourcelistener - The ActionListener to be added
java.lang.NullPointerException - if listener
is nullpublic javax.faces.event.ActionListener[] getActionListeners()
Return the set of registered ActionListeners for this
ActionSource2 instance. If there are no registered listeners,
a zero-length array is returned.
getActionListeners in interface javax.faces.component.ActionSourcepublic void removeActionListener(javax.faces.event.ActionListener listener)
Remove an existing ActionListener (if any) from the set of
listeners interested in being notified when ActionEvents
occur.
removeActionListener in interface javax.faces.component.ActionSourcelistener - The ActionListener to be removed
java.lang.NullPointerException - if listener
is nullpublic void processDecodes(javax.faces.context.FacesContext context)
The DropDown needs to override the standard decoding behaviour since it may also be an action source. We decode the component w.r.t. the value first, and validate it if the component is immediate. Then we fire an action event.
processDecodes in class WebuiInputcontext - FacesContext for this request.
java.lang.NullPointerException
public void broadcast(javax.faces.event.FacesEvent event)
throws javax.faces.event.AbortProcessingException
In addition to to the default UIComponent.broadcast(javax.faces.event.FacesEvent)
processing, pass the ActionEvent being broadcast to the method
referenced by actionListener (if any), and to the default
ActionListener registered on the Application.
broadcast in class WebuiInputevent - FacesEvent to be broadcast
javax.faces.event.AbortProcessingException - Signal the JavaServer Faces
implementation that no further processing on the current event should be
performed @exception IllegalArgumentException if the implementation class
of this FacesEvent is not supported by this component
java.lang.NullPointerException - if event is
nullpublic void queueEvent(javax.faces.event.FacesEvent e)
Intercept queueEvent and, for ActionEvents, mark
the phaseId for the event to be PhaseId.APPLY_REQUEST_VALUES
if the immediate flag is true,
PhaseId.INVOKE_APPLICATION otherwise.
queueEvent in class javax.faces.component.UIComponentBasepublic void validate(javax.faces.context.FacesContext context)
validate in class javax.faces.component.UIInputpublic java.lang.Object saveState(javax.faces.context.FacesContext context)
ListSelectorSave the state of this component.
saveState in interface javax.faces.component.StateHoldersaveState in class ListSelector
public void restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
ListSelectorRestore the state of this component.
restoreState in interface javax.faces.component.StateHolderrestoreState in class ListSelectorpublic java.lang.String getOnSelect()
SelectorScripting code executed when some text in this component value is selected.
getOnSelect in class Selectorpublic int getRows()
ListSelectorInteger.MIN_VALUE
is returned if no value has been set, or there is no value binding.
Subclasses should provide a reasonable default.
getRows in interface com.sun.webui.jsf.component.ListManagergetRows in class ListSelectorpublic void setRows(int DisplayRows)
setRows in class ListSelectorDisplayRows - New value of property DisplayRows.ListSelector.getRows()public java.lang.Object getValue()
getValue in interface javax.faces.component.ValueHoldergetValue in class javax.faces.component.UIOutputpublic java.lang.String getWidth()
If no value has been set, a default value is determined from
the theme property dropDown.width defined in the
messages theme category. If this theme
property is not defined, the width is determined by the
longest option element in the rendered select element.
getWidth in interface com.sun.webui.jsf.component.ListManagergetWidth in class ListSelectorpublic javax.el.MethodExpression getActionExpression()
Used to specify the action to take when this component is activated by the user. The value of the actionExpression attribute must be one of the following:
(faces-config.xml).java.io.Serializable interface or
javax.faces.component.StateHolder interface.When you use the actionExpression attribute in the DropDown component, you must set the submitForm attribute to true.
getActionExpression in interface javax.faces.component.ActionSource2public void setActionExpression(javax.el.MethodExpression me)
The actionExpression attribute is used to specify the action to take when this component is activated by the user. The value of the actionExpression attribute must be one of the following:
(faces-config.xml).java.io.Serializable interface or
javax.faces.component.StateHolder interface.When you use the actionExpression attribute in the DropDown component, you must also set the submitForm attribute to true.
setActionExpression in interface javax.faces.component.ActionSource2public javax.faces.el.MethodBinding getAction()
getAction in interface javax.faces.component.ActionSourcepublic void setAction(javax.faces.el.MethodBinding action)
setAction in interface javax.faces.component.ActionSourcepublic javax.faces.el.MethodBinding getActionListener()
getActionListener in interface javax.faces.component.ActionSourcepublic void setActionListener(javax.faces.el.MethodBinding actionListener)
setActionListener in interface javax.faces.component.ActionSourcepublic javax.el.MethodExpression getActionListenerExpression()
The actionListenerExpression attribute is used to specify a method to handle
an action event that is triggered when this
component is activated by the user. The actionListenerExpression attribute
value must be a JavaServer Faces EL expression that resolves
to a method in a backing bean. The method must take a single parameter
that is an ActionEvent, and its return type must be void.
The class that defines the method must implement the java.io.Serializable
interface or javax.faces.component.StateHolder interface.
The actionListenerExpression method is only invoked when the submitForm attribute is true.
public void setActionListenerExpression(javax.el.MethodExpression me)
The actionListenerExpression attribute is used to specify a method to handle
an action event that is triggered when this
component is activated by the user. The actionListenerExpression attribute
value must be a JavaServer Faces EL expression that resolves
to a method in a backing bean. The method must take a single parameter
that is an ActionEvent, and its return type must be void.
The class that defines the method must implement the java.io.Serializable
interface or javax.faces.component.StateHolder interface.
The actionListenerExpression method is only invoked when the submitForm attribute is true.
public boolean isForgetValue()
If this flag is set to true, then the component is always rendered with no initial selection. By default, the component displays the selection that was made in the last submit of the page. This value should be set to true when the drop down is used for navigation.
public void setForgetValue(boolean forgetValue)
If this flag is set to true, then the component is always rendered with no initial selection. By default, the component displays the selection that was made in the last submit of the page. This value should be set to true when the drop down is used for navigation.
isForgetValue()public boolean isNavigateToValue()
When this attribute is set to true, the value of the menu selection is used as the action, to determine which page is displayed next according to the registered navigation rules. Use this attribute instead of the action attribute when the drop down is used for navigation. When you set navigateToValue to true, you must also set submitForm to true.
public void setNavigateToValue(boolean navigateToValue)
When this attribute is set to true, the value of the menu selection is used as the action, to determine which page is displayed next according to the registered navigation rules. Use this attribute instead of the action attribute when the drop down is used for navigation. When you set navigateToValue to true, you must also set submitForm to true.
isNavigateToValue()public boolean isReadOnly()
If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.
Deprecated: The attribute is deprecated starting from version 4.1
isReadOnly in interface com.sun.webui.jsf.component.SelectorManagerisReadOnly in class Selectorpublic boolean isSubmitForm()
When the submitForm attribute is set to true, the form is immediately submitted when the user changes the selection in the drop down list.
public void setSubmitForm(boolean submitForm)
When this attribute is set to true, the form is immediately submitted when the user changes the selection in the drop down list.
isSubmitForm()public java.lang.String getToolTip()
Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.
getToolTip in interface com.sun.webui.jsf.component.ListManagergetToolTip in class Selectorpublic void setToolTip(java.lang.String toolTip)
Sets the value of the title attribute for the HTML element. The specified text will display as a tooltip if the mouse cursor hovers over the HTML element.
setToolTip in class SelectorgetToolTip()public boolean isLabelOnTop()
If true, the label is rendered above the component. If false, the label is rendered next to the component.
If this property is not set by the application, a themed default
value will be sought, using the key dropDown.labelOnTop
from the messages.properties file. If there is no
value for the key, false is returned.
isLabelOnTop in class ListSelectorpublic void setLabelOnTop(boolean labelOnTop)
If true, the label is rendered above the component. If false, the label is rendered next to the component.
setLabelOnTop in class ListSelectorisLabelOnTop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||