|
||||||||||
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
public class ListSelector
Base component for UI components that allow the user to make a selection from a list of options using an HTML select element.
Field Summary | |
---|---|
static java.lang.String |
LABEL_FACET
The name of the label facet. |
static java.lang.String |
LIST_ID
|
static java.lang.String |
VALUE_ID
|
static java.lang.String |
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 | |
---|---|
ListSelector()
Creates a new instance of ListSelector |
Method Summary | |
---|---|
void |
checkSelectionModel(javax.faces.context.FacesContext context)
Check that this component has a valuebinding that matches the value of the "multiple" attribute. |
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getFocusElementId(javax.faces.context.FacesContext context)
Returns the id of an HTML element suitable to receive the focus. |
javax.faces.component.UIComponent |
getIndicatorComponent(javax.faces.context.FacesContext context,
Label label)
Return a component instance that can be referenced by a Label in order to evaluate the required
and valid states of this component. |
javax.faces.component.UIComponent |
getLabelComponent()
Return a component that implements the label for this ListSelector. |
java.lang.String |
getLabeledElementId(javax.faces.context.FacesContext context)
Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute. |
java.util.Iterator |
getListItems()
Retrieve an Iterator of ListSelector.ListItem, to be used when evaluting the list items. |
java.util.Iterator |
getListItems(javax.faces.context.FacesContext context,
boolean rulerAtEnd)
Retrieve an Iterator of ListSelector.ListItem, to be used by the renderer. |
java.lang.String |
getPrimaryElementID(javax.faces.context.FacesContext context)
Deprecated. |
javax.faces.component.UIComponent |
getReadOnlyValueComponent()
Return a component that implements the read only value of this ListSelector. |
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. |
int |
getSeparatorLength()
This method resets the options. |
java.lang.String |
getValueAsReadOnly(javax.faces.context.FacesContext context,
java.lang.String separator)
Return a string suitable for displaying the value in read only mode. |
java.lang.String[] |
getValueAsStringArray(javax.faces.context.FacesContext context)
Get the value (the object representing the selection(s)) of this component as a String array. |
java.lang.String |
getWidth()
Return a value suitable for the CSS width property to be applied to an HTML select element. |
boolean |
isLabelOnTop()
If true, the label is rendered above the component. |
boolean |
isSeparators()
Flag indicating that items corresponding to com.sun.webui.jsf.model.Option that are defined
inside a com.sun.webui.jsf.model.OptionGroup should be
surrounded by separators inside the list. |
boolean |
isVisible()
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
boolean |
mainListSubmits()
|
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 |
setLabelOnTop(boolean labelOnTop)
If this attribute is true, the label is rendered above the component. |
void |
setRows(int rows)
The number of items to display. |
void |
setSeparators(boolean separators)
Flag indicating that items corresponding to com.sun.webui.jsf.model.Option that are defined
inside a com.sun.webui.jsf.model.OptionGroup should be
surrounded by separators inside the list. |
void |
setVisible(boolean visible)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. |
void |
setWidth(java.lang.String width)
width is a value for the CSS width
property suitable for the select HTML element. |
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, getOnSelect, getRendersChildren, getSelected, getStyle, getStyleClass, getTabIndex, getToolTip, getValueExpression, isDisabled, isMultiple, isReadOnly, setDisabled, setItems, setLabel, setLabelLevel, setMultiple, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setSelected, setStyle, setStyleClass, setTabIndex, setToolTip, setValueExpression, toString |
Methods inherited from class com.sun.webui.jsf.component.WebuiInput |
---|
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processDecodes, 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, validate |
Methods inherited from class javax.faces.component.UIOutput |
---|
getConverter, getLocalValue, getValue |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, 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 com.sun.webui.jsf.component.ListManager |
---|
getToolTip |
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.webui.jsf.component.SelectorManager |
---|
getClientId, getOnChange, getStyle, getStyleClass, getTabIndex, isDisabled, isMultiple, isReadOnly |
Field Detail |
---|
public static final java.lang.String LABEL_FACET
public static final java.lang.String VALUE_ID
public static final java.lang.String VALUE_LABEL_ID
public static final java.lang.String LIST_ID
Constructor Detail |
---|
public ListSelector()
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class Selector
public void checkSelectionModel(javax.faces.context.FacesContext context)
context
- The FacesContext of the requestpublic java.util.Iterator getListItems(javax.faces.context.FacesContext context, boolean rulerAtEnd) throws javax.faces.FacesException
getListItems
in interface com.sun.webui.jsf.component.ListManager
ListItem
.
javax.faces.FacesException
public java.util.Iterator getListItems() throws javax.faces.FacesException
ListItem
.
javax.faces.FacesException
public int getSeparatorLength()
public javax.faces.component.UIComponent getLabelComponent()
label
is found
that component is returned. Otherwise a Label
component
is returned. It is assigned the id
getId() + "_label"
If the facet is not defined then the returned Label
component is re-intialized every time this method is called.
public javax.faces.component.UIComponent getReadOnlyValueComponent()
readOnly
is found
that component is returned. Otherwise a StaticText
component
is returned. It is assigned the id
getId() + "_readOnly"
If the facet is not defined then the returned StaticText
component is re-intialized every time this method is called.
getReadOnlyValueComponent
in interface com.sun.webui.jsf.component.ListManager
public java.lang.String[] getValueAsStringArray(javax.faces.context.FacesContext context)
getValueAsStringArray
in interface com.sun.webui.jsf.component.ListManager
context
- The FacesContext of the requestpublic java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
for
attribute.
If the ComplexComponent
has sub-compoents, and one of
the sub-components is the target of a label, if that sub-component
is a ComplexComponent
, then
getLabeledElementId
must called on the sub-component and
the value returned. The value returned by this
method call may or may not resolve to a component instance.
If isReadOnly
returns true, then the
getReadOnlyValueComponent
method is called. If the
component instance returned is a ComplexComponent
then getLabeledElementId
is called on it and the
value returned, else its client id is returned.
getLabeledElementId
in interface com.sun.webui.jsf.component.ComplexComponent
context
- The FacesContext used for the request
for
attribute.public java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
ComplexComponent
has sub-compoents, and one of
the sub-components is to reveive the focus, if that sub-component
is a ComplexComponent
, then
getFocusElementId
must called on the sub-component and
the value returned. The value returned by this
method call may or may not resolve to a component instance.
This implementations returns the value of
getLabeledElementId
.
getFocusElementId
in interface com.sun.webui.jsf.component.ComplexComponent
context
- The FacesContext used for the requestpublic javax.faces.component.UIComponent getIndicatorComponent(javax.faces.context.FacesContext context, Label label)
Label
in order to evaluate the required
and valid
states of this component.
getIndicatorComponent
in interface com.sun.webui.jsf.component.ComplexComponent
context
- The current FacesContext
instancelabel
- The Label
that labels this component.
UIComponent
in order to evaluate the
required and valid states.public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
getPrimaryElementID
in interface com.sun.webui.jsf.component.ComplexComponent
context
- The FacesContext for the request
getLabeledElementId(javax.faces.context.FacesContext)
,
getFocusElementId(javax.faces.context.FacesContext)
public java.lang.String getValueAsReadOnly(javax.faces.context.FacesContext context, java.lang.String separator)
context
- The FacesContext
javax.faces.FacesException
- If the list items cannot be processedpublic boolean mainListSubmits()
mainListSubmits
in interface com.sun.webui.jsf.component.ListManager
public boolean isLabelOnTop()
If true, the label is rendered above the component. If false, the label is rendered next to the component. The default is false.
public void setLabelOnTop(boolean labelOnTop)
If this attribute is true, the label is rendered above the component. If it is false, the label is rendered next to the component. The default is false.
isLabelOnTop()
public int getRows()
Integer.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.ListManager
public void setRows(int rows)
getRows()
public boolean isSeparators()
Flag indicating that items corresponding to
com.sun.webui.jsf.model.Option
that are defined
inside a com.sun.webui.jsf.model.OptionGroup
should be
surrounded by separators inside the list. The default value is
true. If false, no separators are shown. To manually specify the
location of separators, set this flag to false and place
instances of com.sun.webui.jsf.model.Separator
between
the relevant com.sun.webui.jsf.model.Option
instances
when specifying the items
attribute.
public void setSeparators(boolean separators)
Flag indicating that items corresponding to
com.sun.webui.jsf.model.Option
that are defined
inside a com.sun.webui.jsf.model.OptionGroup
should be
surrounded by separators inside the list. The default value is
true. If false, no separators are shown. To manually specify the
location of separators, set this flag to false and place
instances of com.sun.webui.jsf.model.Separator
between
the relevant com.sun.webui.jsf.model.Option
instances
when specifying the items
attribute.
isSeparators()
public boolean isVisible()
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
isVisible
in interface com.sun.webui.jsf.component.ListManager
isVisible
in class Selector
public void setVisible(boolean visible)
Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.
setVisible
in class Selector
isVisible()
public java.lang.String getWidth()
This ListSelector base class interprets a null value to imply that the select element should size itself based on the length of the longest option.
getWidth
in interface com.sun.webui.jsf.component.ListManager
public void setWidth(java.lang.String width)
width
is a value for the CSS width
property suitable for the select
HTML element.
As a CSS string property value, width
is assumed to contain the units. For example:
ListSelector
and may
not be by its subclasses. It is intended to be applied directly
to the style attribute of the select element.
If width
is null, ListSelector
behavior
will assume the size of the select element will be based on the
length of the longest Option
item's text
property, and if that is not set, its label
property.
width
- The width of the listbox.getWidth()
,
The Option.label property
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 Selector
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 Selector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |