public class Sheet
extends javax.faces.component.UIInput
implements javax.faces.component.behavior.ClientBehaviorHolder, javax.faces.component.EditableValueHolder, org.primefaces.component.api.Widget
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COMPONENT_FAMILY |
static java.lang.String |
COMPONENT_TYPE |
static java.lang.String |
EVENT_CELL_SELECT |
static java.lang.String |
EVENT_CHANGE |
static java.lang.String |
EVENT_COLUMN_SELECT |
static java.lang.String |
EVENT_FILTER |
static java.lang.String |
EVENT_ROW_SELECT |
static java.lang.String |
EVENT_SORT |
| Constructor and Description |
|---|
Sheet()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendUpdateEvent(java.lang.Object rowKey,
int colIndex,
java.lang.Object rowData,
java.lang.Object oldValue,
java.lang.Object newValue)
Appends an update event
|
void |
commitUpdates()
Invoke this method to commit the most recent set of ajax updates and restart the tracking of changes.
|
protected org.primefaces.model.SortOrder |
convertSortOrder()
Convert to PF SortOrder enum since we are leveraging PF sorting code.
|
java.util.List<SheetColumn> |
getColumns()
The list of child columns.
|
java.lang.String |
getCurrentColClass()
The col style class to use for the selected col
|
java.lang.String |
getCurrentRowClass()
The row style class to use for the selected row
|
java.lang.String |
getDefaultEventName() |
java.lang.String |
getEmptyMessage()
The emptyMessage value.
|
java.lang.String |
getErrorMessage()
The error message to display when the sheet is in error.
|
java.util.Collection<java.lang.String> |
getEventNames() |
java.lang.String |
getFamily() |
java.lang.Integer |
getFixedCols()
The fixed column count.
|
java.lang.Integer |
getFixedRows()
The fixed row count
|
java.lang.String |
getFocusId()
The focusId value.
|
java.lang.Integer |
getHeight()
The height of the sheet.
|
java.lang.String |
getInvalidDataValue()
Generates the bad data var value for this sheet.
|
java.util.List<SheetInvalidUpdate> |
getInvalidUpdates()
The list of invalid updates
|
java.lang.Object |
getLocalValue(java.lang.String rowKey,
int col)
Retrieves the submitted value for the rowKey and col.
|
int |
getMappedColumn(int renderIdx)
Maps the rendered column index to the real column index.
|
int |
getRenderIndexFromRealIdx(int realIdx)
Provides the render column index based on the real index
|
java.lang.String |
getRenderValueForCell(javax.faces.context.FacesContext context,
java.lang.String rowKey,
int col)
Gets the render string for the value the given cell.
|
int |
getRowCount()
The number of rows in the value list.
|
protected java.lang.Object |
getRowKeyValue(javax.faces.context.FacesContext context)
Gets the rowKey for the current row
|
protected java.lang.String |
getRowKeyValueAsString(javax.faces.context.FacesContext context)
Gets the row key value as a string for the current row var.
|
protected java.lang.String |
getRowKeyValueAsString(java.lang.Object key)
Gets the row key value as a String suitable for use in javascript rendering.
|
java.lang.String |
getRowStyleClass()
The row style class to apply to each row
|
java.lang.Integer |
getSelectedColumn()
The currently selected column.
|
java.lang.Integer |
getSelectedLastColumn()
The currently selected column.
|
java.lang.Integer |
getSelectedLastRow()
The currently selected row.
|
java.lang.Integer |
getSelectedRow()
The currently selected row.
|
java.lang.String |
getSelection()
The selection value.
|
javax.el.ValueExpression |
getSortByValueExpression()
The current sortBy value expression in use.
|
int |
getSortColRenderIndex()
Gets the rendered col index of the column corresponding to the current sortBy.
|
java.util.List<java.lang.Object> |
getSortedValues()
The sorted list of values.
|
java.lang.String |
getSortOrder()
The sort direction
|
java.lang.String |
getStretchH()
The handsontable stretchH value.
|
java.lang.String |
getStyleClass()
The user's custom style class to be added to the div container for the sheet.
|
java.lang.Object |
getSubmittedValue() |
java.lang.String |
getSubmittedValue(java.lang.String rowKey,
int col)
Retrieves the submitted value for the row and col.
|
java.util.List<SheetUpdate> |
getUpdates()
A list of updates from the last submission or ajax event.
|
java.lang.Object |
getValue()
Return the value of the Sheet.
|
java.lang.Object |
getValueForCell(javax.faces.context.FacesContext context,
java.lang.String rowKey,
int col)
Gets the object value of the row and col specified.
|
java.lang.String |
getVar()
Return the request-scope attribute under which the data object for the current row will be exposed when iterating.
|
java.lang.Integer |
getWidth()
The width of the sheet in pixels
|
boolean |
isHasStyledCells()
Returns true if any of the columns contain conditional styling.
|
java.lang.Boolean |
isShowColumnHeaders()
Flag indicating whether or not column headers are visible
|
java.lang.Boolean |
isShowRowHeaders()
The ShowRowHeaders flag
|
protected boolean |
matchesFilter(java.lang.Object obj)
Evaluates the specified item value against the column filters and if they match, returns true, otherwise false.
|
void |
processValidators(javax.faces.context.FacesContext context) |
protected void |
reMapRows()
Remaps the row keys to the sorted and filtered list.
|
protected void |
renderBadUpdateScript(javax.faces.context.FacesContext context)
Adds eval scripts to update the bad data array in the sheet to render validation failures produced by the most recent ajax update attempt.
|
protected void |
renderRowUpdateScript(javax.faces.context.FacesContext context,
java.util.Set<java.lang.String> dirtyRows)
Adds eval scripts to the ajax response to update the rows dirtied by the most recent successful update request.
|
void |
reset()
Resets all filters, sorting and submitted values.
|
void |
resetInvalidUpdates()
Resets invalid updates
|
void |
resetSort()
Resets the sorting to the originally specified values (if any)
|
void |
resetSubmitted()
Resets the submitted values
|
java.lang.String |
resolveWidgetVar() |
void |
restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
Restores the state for the submitted, local and bad values.
|
java.lang.Object |
saveState(javax.faces.context.FacesContext context)
Saves the state of the submitted and local values and the bad updates.
|
void |
setColumns(java.util.List<SheetColumn> columns)
Updates the list of child columns.
|
void |
setCurrentColClass(java.lang.String styleClass)
Update the current row style class
|
void |
setCurrentRowClass(java.lang.String styleClass)
Update the current row style class
|
void |
setEmptyMessage(java.lang.String value)
Update the emptyMessage value for the component
|
void |
setErrorMessage(java.lang.String value)
Updates the errorMessage value.
|
void |
setFixedCols(java.lang.Integer value)
Updates the fixed columns count.
|
void |
setFixedRows(java.lang.Integer value)
Updates the fixed row count.
|
void |
setFocusId(java.lang.String focusId)
Updates the focusId value.
|
void |
setHeight(java.lang.Integer value)
Updates the height
|
void |
setLocalValue(java.lang.String rowKey,
int col,
java.lang.Object value)
Updates a local value.
|
void |
setRowStyleClass(java.lang.String styleClass)
Update the current row style class to apply to the row
|
void |
setRowVar(javax.faces.context.FacesContext context,
java.lang.String rowKey)
Updates the row var for iterations over the list.
|
void |
setSelectedColumn(java.lang.Integer col)
Updates the selected column.
|
void |
setSelectedLastColumn(java.lang.Integer col)
Updates the selected column.
|
void |
setSelectedLastRow(java.lang.Integer row)
Updates the selected row.
|
void |
setSelectedRow(java.lang.Integer row)
Updates the selected row.
|
void |
setSelection(java.lang.String selection)
Updates the selection value.
|
void |
setShowColumnHeaders(java.lang.Boolean value)
Update the ShowColumnheaders
|
void |
setShowRowHeaders(java.lang.Boolean value)
Update the ShowRowHeaders value.
|
void |
setSortByValueExpression(javax.el.ValueExpression sortBy)
Update the sort field
|
void |
setSortOrder(java.lang.String sortOrder)
Update the sort direction
|
void |
setStretchH(java.lang.String value)
Update the stretcH value for the component
|
void |
setStyleClass(java.lang.String styleClass)
Update's the user's custom style class to be added to the div container for the sheet.
|
void |
setSubmittedValue(javax.faces.context.FacesContext context,
java.lang.String rowKey,
int col,
java.lang.String value)
Updates a submitted value.
|
void |
setSubmittedValue(java.lang.Object submittedValue) |
void |
setValue(java.lang.Object value)
Set the value of the
Sheet. |
void |
setVar(java.lang.String var)
Set the request-scope attribute under which the data object for the current row wil be exposed when iterating.
|
void |
setWidth(java.lang.Integer value)
Updates the width
|
void |
sortAndFilter()
Sorts and filters the data
|
void |
updateColumnMappings()
Updates the column mappings based on the rendered attribute
|
void |
updateModel(javax.faces.context.FacesContext context)
Override to update model with local values.
|
void |
validate(javax.faces.context.FacesContext context)
Converts each submitted value into a local value and stores it back in the hash.
|
addValidator, addValueChangeListener, clearInitialState, compareValues, decode, getConvertedValue, getConverterMessage, getRequiredMessage, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isEmpty, isImmediate, isLocalValueSet, isRequired, isValid, markInitialState, processDecodes, processUpdates, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setValid, setValidator, setValidatorMessage, setValueChangeListener, validateValuegetConverter, getLocalValue, setConverteraddClientBehavior, addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEventencodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTreeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddClientBehavior, getClientBehaviorsaddValidator, addValueChangeListener, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setImmediate, setLocalValueSet, setRequired, setValid, setValidator, setValueChangeListenerpublic static final java.lang.String EVENT_CELL_SELECT
public static final java.lang.String EVENT_CHANGE
public static final java.lang.String EVENT_SORT
public static final java.lang.String EVENT_FILTER
public static final java.lang.String EVENT_COLUMN_SELECT
public static final java.lang.String EVENT_ROW_SELECT
public static final java.lang.String COMPONENT_TYPE
public static final java.lang.String COMPONENT_FAMILY
public java.lang.String getFamily()
getFamily in class javax.faces.component.UIInputpublic java.util.Collection<java.lang.String> getEventNames()
getEventNames in interface javax.faces.component.behavior.ClientBehaviorHoldergetEventNames in class javax.faces.component.UIComponentBasepublic java.lang.String getDefaultEventName()
getDefaultEventName in interface javax.faces.component.behavior.ClientBehaviorHoldergetDefaultEventName in class javax.faces.component.UIComponentBasepublic java.lang.String resolveWidgetVar()
resolveWidgetVar in interface org.primefaces.component.api.Widgetpublic void setStyleClass(java.lang.String styleClass)
styleClass - public java.lang.String getStyleClass()
public void setStretchH(java.lang.String value)
value - public java.lang.String getStretchH()
public void setEmptyMessage(java.lang.String value)
value - public java.lang.String getEmptyMessage()
public void setCurrentColClass(java.lang.String styleClass)
styleClass - public java.lang.String getCurrentColClass()
styleClass - public void setCurrentRowClass(java.lang.String styleClass)
styleClass - public java.lang.String getCurrentRowClass()
styleClass - public void setRowStyleClass(java.lang.String styleClass)
styleClass - public java.lang.String getRowStyleClass()
styleClass - public void setShowColumnHeaders(java.lang.Boolean value)
value - public java.lang.Boolean isShowColumnHeaders()
public void setShowRowHeaders(java.lang.Boolean value)
value - public java.lang.Boolean isShowRowHeaders()
public java.util.List<SheetColumn> getColumns()
public void setColumns(java.util.List<SheetColumn> columns)
columns - public void setFixedRows(java.lang.Integer value)
value - public java.lang.Integer getFixedRows()
public void setFixedCols(java.lang.Integer value)
value - public java.lang.Integer getFixedCols()
public java.util.List<SheetInvalidUpdate> getInvalidUpdates()
public void resetSubmitted()
public void resetSort()
public void resetInvalidUpdates()
public void reset()
public void setSubmittedValue(javax.faces.context.FacesContext context,
java.lang.String rowKey,
int col,
java.lang.String value)
row - col - value - public java.lang.String getSubmittedValue(java.lang.String rowKey,
int col)
row - col - public void setLocalValue(java.lang.String rowKey,
int col,
java.lang.Object value)
rowKey - col - value - public java.lang.Object getLocalValue(java.lang.String rowKey,
int col)
row - col - public void setRowVar(javax.faces.context.FacesContext context,
java.lang.String rowKey)
context - the FacesContext against which to the row var is set. Passed for performancerowKey - the rowKey stringpublic java.lang.Object getValueForCell(javax.faces.context.FacesContext context,
java.lang.String rowKey,
int col)
context - rowKey - col - public java.lang.String getRenderValueForCell(javax.faces.context.FacesContext context,
java.lang.String rowKey,
int col)
context - rowKey - col - public java.lang.Integer getSelectedColumn()
public void setSelectedColumn(java.lang.Integer col)
col - public java.lang.Integer getSelectedLastColumn()
public void setSelectedLastColumn(java.lang.Integer col)
col - public java.lang.Integer getSelectedRow()
public java.lang.Integer getSelectedLastRow()
public void setSelectedRow(java.lang.Integer row)
row - public void setSelectedLastRow(java.lang.Integer row)
row - public java.lang.Integer getWidth()
public void setWidth(java.lang.Integer value)
row - public java.lang.Integer getHeight()
public void setHeight(java.lang.Integer value)
row - public java.lang.Object getValue()
getValue in interface javax.faces.component.ValueHoldergetValue in class javax.faces.component.UIInputpublic java.util.List<java.lang.Object> getSortedValues()
public int getSortColRenderIndex()
protected boolean matchesFilter(java.lang.Object obj)
obj - public void sortAndFilter()
protected void reMapRows()
protected java.lang.Object getRowKeyValue(javax.faces.context.FacesContext context)
context - the faces contextprotected java.lang.String getRowKeyValueAsString(java.lang.Object key)
context - protected java.lang.String getRowKeyValueAsString(javax.faces.context.FacesContext context)
context - protected org.primefaces.model.SortOrder convertSortOrder()
public void setValue(java.lang.Object value)
Sheet. This value must be a java.util.List at this time.setValue in interface javax.faces.component.ValueHoldersetValue in class javax.faces.component.UIInputvalue - the new valuepublic java.lang.String getVar()
public void setVar(java.lang.String var)
var - The new request-scope attribute namepublic javax.el.ValueExpression getSortByValueExpression()
public void setSortByValueExpression(javax.el.ValueExpression sortBy)
sortBy - public java.lang.String getSortOrder()
public void setSortOrder(java.lang.String sortOrder)
sortOrder - public java.lang.String getErrorMessage()
public void setErrorMessage(java.lang.String value)
value - public void processValidators(javax.faces.context.FacesContext context)
processValidators in class javax.faces.component.UIInputpublic void validate(javax.faces.context.FacesContext context)
validate in class javax.faces.component.UIInputpublic void updateModel(javax.faces.context.FacesContext context)
updateModel in class javax.faces.component.UIInputpublic java.lang.Object saveState(javax.faces.context.FacesContext context)
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UIInputpublic void restoreState(javax.faces.context.FacesContext context,
java.lang.Object state)
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UIInputpublic java.lang.String getSelection()
public void setSelection(java.lang.String selection)
selection - the selection to setpublic java.lang.Object getSubmittedValue()
getSubmittedValue in interface javax.faces.component.EditableValueHoldergetSubmittedValue in class javax.faces.component.UIInputpublic void setSubmittedValue(java.lang.Object submittedValue)
setSubmittedValue in interface javax.faces.component.EditableValueHoldersetSubmittedValue in class javax.faces.component.UIInputpublic java.util.List<SheetUpdate> getUpdates()
protected void appendUpdateEvent(java.lang.Object rowKey,
int colIndex,
java.lang.Object rowData,
java.lang.Object oldValue,
java.lang.Object newValue)
rowIndex - colIndex - rowData - oldValue - newValue - public boolean isHasStyledCells()
public int getMappedColumn(int renderIdx)
renderIdx - the rendered indexpublic int getRenderIndexFromRealIdx(int realIdx)
realIdx - public void updateColumnMappings()
public int getRowCount()
public java.lang.String getFocusId()
public void setFocusId(java.lang.String focusId)
focusId - the focusId to setpublic void commitUpdates()
public java.lang.String getInvalidDataValue()
protected void renderRowUpdateScript(javax.faces.context.FacesContext context,
java.util.Set<java.lang.String> dirtyRows)
context - the FacesContextdirtyRows - the set of dirty rowsprotected void renderBadUpdateScript(javax.faces.context.FacesContext context)
context - the FacesContextCopyright © 2011–2018. All rights reserved.