public class UIEditableList extends javax.faces.component.UIInput implements javax.faces.component.NamingContainer, ResettableComponent
Allows to add/remove elements from an UIEditableList, inspired from Trinidad UIXCollection component.
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID, VALIDATE_EMPTY_FIELDS_PARAM_NAME| Constructor and Description |
|---|
UIEditableList() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addValue(Object value)
Adds a value to the end of the editable model.
|
void |
broadcast(javax.faces.event.FacesEvent event)
Delivers a wrapped event to the appropriate component.
|
void |
encodeBegin(javax.faces.context.FacesContext context) |
void |
encodeChildren(javax.faces.context.FacesContext context)
Repeatedly render the children as many times as needed.
|
void |
encodeEnd(javax.faces.context.FacesContext context) |
String |
getContainerClientId(javax.faces.context.FacesContext context)
Override container client id resolution to handle recursion.
|
Boolean |
getDiff()
Gets boolean stating if diff must be used when saving the value submitted.
|
EditableModel |
getEditableModel()
Gets the EditableModel to use with this component.
|
String |
getFamily() |
String |
getModel()
Gets model name exposed in request map.
|
Integer |
getNumber() |
ProtectedEditableModel |
getProtectedModel(EditableModel model) |
Boolean |
getRemoveEmpty() |
String |
getRendererType() |
boolean |
getRendersChildren() |
int |
getRowCount()
Gets the total number of rows in this table.
|
Object |
getRowData()
Gets the data for the current row.
|
int |
getRowIndex()
Gets the index of the current row.
|
Integer |
getRowKey()
Gets the rowKey of the current row.
|
Object |
getTemplate()
Gets template to be used when adding new values to the model.
|
Object |
getValue() |
void |
insertValue(int index,
Object value)
Inserts value at given index on the editable model.
|
boolean |
invokeOnComponent(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback) |
boolean |
isRowAvailable()
Checks to see if the current row is available.
|
boolean |
isRowModified()
Checks to see if the current row is modified.
|
Object |
moveValue(int fromIndex,
int toIndex)
Modifies value at given index on the editable model.
|
void |
processDecodes(javax.faces.context.FacesContext context) |
void |
processUpdates(javax.faces.context.FacesContext context) |
void |
processValidators(javax.faces.context.FacesContext context) |
void |
queueEvent(javax.faces.event.FacesEvent event)
Queues an event.
|
void |
recordValueModified(int index,
Object newValue)
Records a value modification.
|
Object |
removeValue(int index)
Removes value at given index on the editable model.
|
void |
resetCachedModel()
Resets the cache model
|
void |
restoreState(javax.faces.context.FacesContext context,
Object state) |
Object |
saveState(javax.faces.context.FacesContext context) |
void |
setDiff(Boolean diff)
Sets boolean stating if diff must be used when saving the value submitted.
|
void |
setModel(String model)
Sets model name exposed in request map.
|
void |
setNumber(Integer number) |
void |
setRemoveEmpty(Boolean removeEmpty) |
void |
setRendererType(String rendererType) |
void |
setRowIndex(int rowIndex)
Makes a row current.
|
void |
setRowKey(Integer rowKey)
Makes a row current.
|
void |
setTemplate(Object template)
Sets template to be used when adding new values to the model.
|
boolean |
visitTree(javax.faces.component.visit.VisitContext context,
javax.faces.component.visit.VisitCallback callback)
Rough adapt of the UI data behaviour.
|
addValidator, addValueChangeListener, clearInitialState, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isEmpty, isImmediate, isLocalValueSet, isRequired, isValid, markInitialState, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validategetConverter, getLocalValue, setConverteraddClientBehavior, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEventencodeAll, getClientId, getCompositeComponentParent, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpressionpublic static final String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
public String getFamily()
getFamily in class javax.faces.component.UIInputpublic Object saveState(javax.faces.context.FacesContext context)
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UIInputpublic Object getValue()
getValue in interface javax.faces.component.ValueHoldergetValue in class javax.faces.component.UIInputpublic void restoreState(javax.faces.context.FacesContext context,
Object state)
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UIInputpublic void resetCachedModel()
Can be useful when re-rendering a list with ajax and not wanting to keep cached values already submitted.
resetCachedModel in interface ResettableComponentpublic ProtectedEditableModel getProtectedModel(EditableModel model)
public final EditableModel getEditableModel()
public final boolean isRowAvailable()
EditableModel.isRowAvailable()public final boolean isRowModified()
EditableModel.isRowModified()public final int getRowCount()
EditableModel.getRowCount()public final int getRowIndex()
EditableModel.getRowIndex()public final Integer getRowKey()
EditableModel.getRowKey()public final Object getRowData()
EditableModel.getRowData()public void setRowIndex(int rowIndex)
This method calls preRowDataChange() and postRowDataChange(java.lang.Object) as appropriate.
rowIndex - The rowIndex of the row that should be made current. Use -1 to clear the current row.EditableModel.setRowIndex(int)public void setRowKey(Integer rowKey)
This method calls preRowDataChange() and postRowDataChange(java.lang.Object) as appropriate.
rowKey - The rowKey of the row that should be made current. Use null to clear the current row.EditableModel.setRowKey(java.lang.Integer)public final void recordValueModified(int index,
Object newValue)
public boolean addValue(Object value)
value - the value to addpublic void insertValue(int index,
Object value)
IllegalArgumentException - if model does not handle this index.public Object moveValue(int fromIndex, int toIndex)
IllegalArgumentException - if model does not handle one of given indexes.public Object removeValue(int index)
IllegalArgumentException - if model does not handle this index.public String getModel()
public void setModel(String model)
public Object getTemplate()
public final void setTemplate(Object template)
public Boolean getDiff()
public void setDiff(Boolean diff)
public Integer getNumber()
public void setNumber(Integer number)
public Boolean getRemoveEmpty()
public void setRemoveEmpty(Boolean removeEmpty)
public String getContainerClientId(javax.faces.context.FacesContext context)
getContainerClientId in class javax.faces.component.UIComponentpublic String getRendererType()
getRendererType in class javax.faces.component.UIComponentBasepublic void setRendererType(String rendererType)
setRendererType in class javax.faces.component.UIComponentBasepublic final void encodeBegin(javax.faces.context.FacesContext context)
throws IOException
encodeBegin in class javax.faces.component.UIComponentBaseIOExceptionpublic void encodeEnd(javax.faces.context.FacesContext context)
throws IOException
encodeEnd in class javax.faces.component.UIComponentBaseIOExceptionpublic boolean getRendersChildren()
getRendersChildren in class javax.faces.component.UIComponentBasepublic void encodeChildren(javax.faces.context.FacesContext context)
throws IOException
encodeChildren in class javax.faces.component.UIComponentBaseIOExceptionpublic void broadcast(javax.faces.event.FacesEvent event)
broadcast in class javax.faces.component.UIComponentBaseevent - a FacesEventjavax.faces.event.AbortProcessingExceptionpublic void queueEvent(javax.faces.event.FacesEvent event)
queueEvent in class javax.faces.component.UIComponentBaseevent - a FacesEventpublic boolean visitTree(javax.faces.component.visit.VisitContext context,
javax.faces.component.visit.VisitCallback callback)
visitTree in class javax.faces.component.UIComponentpublic void processDecodes(javax.faces.context.FacesContext context)
processDecodes in class javax.faces.component.UIInputpublic void processValidators(javax.faces.context.FacesContext context)
processValidators in class javax.faces.component.UIInputpublic void processUpdates(javax.faces.context.FacesContext context)
processUpdates in class javax.faces.component.UIInputpublic boolean invokeOnComponent(javax.faces.context.FacesContext context,
String clientId,
javax.faces.component.ContextCallback callback)
throws javax.faces.FacesException
invokeOnComponent in class javax.faces.component.UIComponentBasejavax.faces.FacesExceptionCopyright © 2015 Nuxeo SA. All rights reserved.