|
||||||||||
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.EditableListBase
com.sun.rave.web.ui.component.EditableList
public class EditableList
This tag renders an EditableList component. Use this component when web application users need to create and modify a list of strings. The application user can add new strings by typing them into the textfield and clicking the "Add" button, and remove them by selecting one or more items from the list and clicking the "Remove" button.
Use the list
attribute to bind the component
to a model. The value must be an EL expression that corresponds to
a managed bean or a property of a managed bean, and it must
evaluate to an array of java.lang.String
.
To set the label of the textfield, use the
fieldLabel
attribute. To set the label of the
textfield, use the listLabel
attribute. To validate
new items, use the fieldValidator
attribute; to
validate the contents of the list once the user has finished
adding and removing items, specify a labelValidator
.
fieldLabel
: use this facet to specify a custom
component for the textfield label.listLabel
: use this facet to specify a custom
component for the textfield label.field
: use this facet to specify a custom
component for the textfield.addButton
: use this facet to specify a custom
component for the add button.removeButton
: use this facet to specify a custom
component for the remove button.search
: use this facet to specify a custom
component for the search button. readOnly
: use this facet to specify a custom
component for display a readonly version of the component.header
: use this facet to specify a header,
rendered in a table row above the component.footer
: use this facet to specify a header,
rendered in a table row below the component.
Field Summary | |
---|---|
static java.lang.String |
ADD_BUTTON_FACET
|
static java.lang.String |
ADD_BUTTON_ID
The component id for the ADD button |
static java.lang.String |
ADD_FUNCTION
Name of the JavaScript function which is responsible for adding elements from the availble list to the selected list |
static java.lang.String |
ENABLE_ADD_FUNCTION
Name of the JavaScript function which is responsible for enabling/disabling the add button |
static java.lang.String |
ENABLE_REMOVE_FUNCTION
Name of the JavaScript function which is responsible for enabling/disabling the remove button |
static java.lang.String |
FIELD_FACET
|
static java.lang.String |
FIELD_ID
The component ID for the textfield |
static java.lang.String |
FIELD_LABEL_FACET
|
static java.lang.String |
FIELD_LABEL_ID
The component ID for the textfield |
static java.lang.String |
FOOTER_FACET
Facet name for the footer facet |
static java.lang.String |
HEADER_FACET
Facet name for the header facet |
static java.lang.String |
JSOBJECT
The name of the component attribute that stores the name of the JavaScript object that organizes the JavsSCript functions for the component |
static java.lang.String |
LIST_LABEL_FACET
|
static java.lang.String |
LIST_LABEL_ID
The component ID for the textfield |
static java.lang.String |
READ_ONLY_FACET
|
static java.lang.String |
READ_ONLY_ID
The component ID for the textfield |
static java.lang.String |
REMOVE_BUTTON_FACET
|
static java.lang.String |
REMOVE_BUTTON_ID
The component ID for the remove button |
static java.lang.String |
SEARCH_FACET
Facet name for the search facet |
static java.lang.String |
SET_ADD_DISABLED_FUNCTION
Name of the JavaScript function which is responsible for enabling/disabling the add button |
static java.lang.String |
SPACER_STRING
|
static java.lang.String |
UPDATE_BUTTONS_FUNCTION
Name of the JavaScript function that updates the buttons |
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 | |
---|---|
EditableList()
|
Method Summary | |
---|---|
protected boolean |
compareValues(java.lang.Object previous,
java.lang.Object value)
Return true if the new value is different from the
previous value. |
javax.faces.component.UIComponent |
getAddButtonComponent()
Get or create the ADD button. |
java.lang.Object |
getConvertedValue(javax.faces.context.FacesContext context,
java.lang.Object submittedValue)
Retrieve the value of this component (the "selected" property) as an object. |
javax.faces.component.UIComponent |
getFieldComponent()
Gets or creates a component for the textfield. |
javax.faces.component.UIComponent |
getFieldLabelComponent()
Gets or creates a component for the textfield label. |
java.lang.String |
getJavaScriptObjectName()
|
java.util.Iterator |
getListItems(javax.faces.context.FacesContext context,
boolean rulerAtEnd)
Retrieve an Iterator of ListSelector.ListItem, to be used by the renderer. |
javax.faces.component.UIComponent |
getListLabelComponent()
Gets or creates a component for the list label. |
int |
getMaxlLength()
Get the maximum length of the strings on the list |
java.lang.String |
getOnChange()
Get the JS onchange event handler |
java.lang.String |
getPrimaryElementID(javax.faces.context.FacesContext context)
Implement this method so that it returns the DOM ID of the HTML element which should receive focus when the component receives focus, and to which a component label should apply. |
javax.faces.component.UIComponent |
getReadOnlyValueComponent()
Creates a component for the EditableList in case the component is read-only. |
javax.faces.component.UIComponent |
getRemoveButtonComponent()
Get or create the REMOVE button. |
protected java.lang.String |
getValueAsReadOnly(javax.faces.context.FacesContext context)
Return a string suitable for displaying the value in read only mode. |
java.lang.String[] |
getValueAsStringArray(javax.faces.context.FacesContext context)
Get the value of the component as a String array. |
java.lang.String[] |
getValuesToRemove()
Getter for property valuesToRemove. |
boolean |
isImmediate()
Always returns false for EditableList |
boolean |
mainListSubmits()
|
void |
processAddAction()
|
void |
processRemoveAction()
|
void |
processValidators(javax.faces.context.FacesContext context)
|
void |
setConverter(javax.faces.convert.Converter converter)
|
void |
setValuesToRemove(java.lang.String[] valuesToRemove)
Setter for property valuesToRemove. |
Methods inherited from class com.sun.rave.web.ui.component.EditableListBase |
---|
getFamily, getFieldLabel, getFieldValidator, getLabelLevel, getList, getListLabel, getListValidator, getMaxLength, getRows, getStyle, getStyleClass, getTabIndex, getToolTip, getValueBinding, isDisabled, isListOnTop, isMultiple, isReadOnly, isSorted, isVisible, restoreState, saveState, setDisabled, setFieldLabel, setFieldValidator, setLabelLevel, setList, setListLabel, setListOnTop, setListValidator, setMaxLength, setMultiple, setReadOnly, setRows, setSorted, setStyle, setStyleClass, setTabIndex, setToolTip, setValueBinding, setVisible |
Methods inherited from class javax.faces.component.UIInput |
---|
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, 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 |
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, getRendersChildren, 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, toString, 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, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValueChangeListener |
Methods inherited from interface javax.faces.component.ValueHolder |
---|
getConverter, getLocalValue, getValue, setValue |
Methods inherited from interface com.sun.rave.web.ui.component.SelectorManager |
---|
getClientId, getStyle, getStyleClass, getTabIndex, isDisabled, isMultiple, isReadOnly |
Field Detail |
---|
public static final java.lang.String ADD_BUTTON_ID
public static final java.lang.String ADD_BUTTON_FACET
public static final java.lang.String REMOVE_BUTTON_ID
public static final java.lang.String REMOVE_BUTTON_FACET
public static final java.lang.String FIELD_ID
public static final java.lang.String FIELD_FACET
public static final java.lang.String LIST_LABEL_ID
public static final java.lang.String LIST_LABEL_FACET
public static final java.lang.String FIELD_LABEL_ID
public static final java.lang.String FIELD_LABEL_FACET
public static final java.lang.String READ_ONLY_ID
public static final java.lang.String READ_ONLY_FACET
public static final java.lang.String HEADER_FACET
public static final java.lang.String FOOTER_FACET
public static final java.lang.String JSOBJECT
public static final java.lang.String ADD_FUNCTION
public static final java.lang.String ENABLE_ADD_FUNCTION
public static final java.lang.String SET_ADD_DISABLED_FUNCTION
public static final java.lang.String ENABLE_REMOVE_FUNCTION
public static final java.lang.String UPDATE_BUTTONS_FUNCTION
public static final java.lang.String SEARCH_FACET
public static final java.lang.String SPACER_STRING
Constructor Detail |
---|
public EditableList()
Method Detail |
---|
public int getMaxlLength()
public javax.faces.component.UIComponent getAddButtonComponent()
public javax.faces.component.UIComponent getRemoveButtonComponent()
public javax.faces.component.UIComponent getListLabelComponent()
public javax.faces.component.UIComponent getFieldLabelComponent()
public javax.faces.component.UIComponent getFieldComponent()
protected java.lang.String getValueAsReadOnly(javax.faces.context.FacesContext context) throws javax.faces.FacesException
context
- The FacesContext
javax.faces.FacesException
- If the list items cannot be processedpublic javax.faces.component.UIComponent getReadOnlyValueComponent()
getReadOnlyValueComponent
in interface ListManager
public void setConverter(javax.faces.convert.Converter converter)
setConverter
in interface javax.faces.component.ValueHolder
setConverter
in class javax.faces.component.UIOutput
converter
- public java.lang.String getJavaScriptObjectName()
public java.lang.String getOnChange()
SelectorManager
getOnChange
in interface SelectorManager
public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
ComplexComponent
getPrimaryElementID
in interface ComplexComponent
context
- The FacesContext for the request
public java.lang.String[] getValuesToRemove()
public void setValuesToRemove(java.lang.String[] valuesToRemove)
valuesToRemove
- New value of property valuesToRemove.public java.util.Iterator getListItems(javax.faces.context.FacesContext context, boolean rulerAtEnd) throws javax.faces.FacesException
getListItems
in interface ListManager
rulerAtEnd
- If this attribute is set to true, the iterator will contain, as the last item, a disabled list option with a blank label whose sole function is to guarantee that the list stays the same size
ListItem
.
javax.faces.FacesException
public java.lang.Object getConvertedValue(javax.faces.context.FacesContext context, java.lang.Object submittedValue) throws javax.faces.convert.ConverterException
getConvertedValue
in class javax.faces.component.UIInput
context
- The FacesContext of the requestsubmittedValue
- The submitted value of the component
javax.faces.convert.ConverterException
public void processValidators(javax.faces.context.FacesContext context)
processValidators
in class javax.faces.component.UIInput
java.lang.NullPointerException
public void processAddAction()
public void processRemoveAction()
public boolean isImmediate()
isImmediate
in interface javax.faces.component.EditableValueHolder
isImmediate
in class javax.faces.component.UIInput
protected boolean compareValues(java.lang.Object previous, java.lang.Object value)
Return true
if the new value is different from the
previous value.
compareValues
in class javax.faces.component.UIInput
previous
- old value of this component (if any)value
- new value of this component (if any)public java.lang.String[] getValueAsStringArray(javax.faces.context.FacesContext context)
ListManager
getValueAsStringArray
in interface ListManager
context
- The FacesContext of the request
public boolean mainListSubmits()
mainListSubmits
in interface ListManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |