Class RichTable
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean,Component,Ordered,ScriptEventSupport,LifecycleElement,Widget,org.springframework.core.Ordered
Decorations implemented depend on widget implementation. Examples are sorting, paging and skinning.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Field Summary
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptionsFields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCodeFields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRowToTableData(String row) Add row content passed from table ftl to the aaData array by converting and escaping the content to an object (in an array of objects) in JSON formatprotected voidbuildSortOptions(LookupView lookupView, CollectionGroup collectionGroup) Builds default sorting options.protected voidbuildTableOptions(CollectionGroup collectionGroup) Builds column options for sortingconstructTableColumnOptions(int target, boolean isSortable, boolean isUseServerPaging, Class<?> dataTypeClass, String sortDataType) Constructs the sort data type for each data table columns in a format that will be used to initialize the data table widget via javascriptGet the translated aaData array generated by calls to addRowToTableData by the ftlSpecifies a URL for acquiring the table data with ajaxgetCellValue(Object model, Field field) Get the simple value as a string that represents the field's sortable value, to be used as val in the custom uif json data object (accessed by mDataProp option on datatables - automated by framework) when using the forceLocalJsonData option or the CollectionGroup's isUseServerPaging optionprotected ConfigurationServiceprotected StringgetDataFieldColumnOptions(int target, CollectionGroup collectionGroup, DataField field) Construct the column options for a data fieldReturns the text which is used to display text when the table is emptyGet groupingOptionHolds propertyNames for the ones meant to be hidden since columns are visible by defaultintThe nestedLevel property represents how many collection tables deep this particular table isHolds the propertyNames for columns that are to be sortedbooleanReturns true if sorting is disabledbooleanIf set to true and the aoColumnDefs template option is explicitly defined in templateOptions, those aoColumnDefs will be used for this table.booleanIf true, the table will automatically use row JSON data generated by this widgetbooleanReturns true if export option is enabledvoidperformFinalize(Object model, LifecycleElement parent) The following initialization is performed: Initializes component options for empty table messageprotected voidSet the translated aaData arrayvoidsetAjaxSource(String ajaxSource) Setter for the Ajax source URLvoidsetDisableTableSort(boolean disableTableSort) Enables/disables the table sortingvoidsetEmptyTableMessage(String emptyTableMessage) Setter for a text to be displayed when the table is emptyvoidsetForceAoColumnDefsOverride(boolean forceAoColumnDefsOverride) Set forceAoColumnDefsOverridevoidsetForceLocalJsonData(boolean forceLocalJsonData) Set the forceLocalJsonData flag to force this table to use generated row json datavoidsetGroupingOptionsJSString(String groupingOptionsJSString) Set the groupingOptions js data.voidsetHiddenColumns(Set<String> hiddenColumns) Setter for the hidden columns setvoidsetNestedLevel(int nestedLevel) Set the nestedLevel for this table - must be set if using forceLocalJsonData and this is a subCollection of a TableCollection (also using forceLocalJsonData)voidsetShowExportOption(boolean showExportOption) Show/Hide the search and export option in tabletoolsvoidsetSortableColumns(Set<String> sortableColumns) Setter for sortable columnsMethods inherited from class org.kuali.rice.krad.uif.widget.WidgetBase
getComponentTypeNameMethods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, afterEvaluateExpression, appendToStyle, checkMutable, clone, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContainerIdSuffix, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPhasePathMapping, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewPath, getViewStatus, getWidth, getWrapperCssClasses, getWrapperCssClassesAsString, getWrapperStyle, initializeComponentSecurity, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, notifyCompleted, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContainerIdSuffix, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, setExcludeIf, setExcludeUnless, setFieldsToSendOnRefresh, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOmitFromFormPost, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPhasePathMapping, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewAuthz, setViewPath, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyle, skipLifecycleMethods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressionsMethods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
copy, dataDictionaryPostProcessing, getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCodeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.uif.component.Component
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, afterEvaluateExpression, appendToStyle, completeValidation, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAdditionalTemplates, getAlign, getAriaAttributes, getAriaAttributesAsString, getCanCopyOnReadOnly, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getCssGridSizes, getDataAttributes, getEventHandlerScript, getExcludeIf, getExcludeUnless, getFieldsToSendOnRefresh, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLibraryCssClasses, getMethodToCallOnRefresh, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getReadOnly, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRole, getRowSpan, getScriptDataAttributes, getScriptDataAttributesJs, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, getWrapperCssClasses, getWrapperStyle, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isOmitFromFormPost, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isRefreshedByAction, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setAriaAttributes, setCanCopyOnReadOnly, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setCssGridSizes, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFieldsToSendOnRefresh, setForceSessionPersistence, setHidden, setLibraryCssClasses, setOmitFromFormPost, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRole, setRowSpan, setScriptDataAttributes, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setViewStatus, setWidth, setWrapperCssClasses, setWrapperStyleMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContainerIdSuffix, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setContainerIdSuffix, setId, setPhasePathMapping, setRender, setViewPath, skipLifecycleMethods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnInputScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnInputScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScriptMethods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, setExpressionGraph, setPropertyExpressions
-
Constructor Details
-
RichTable
public RichTable()
-
-
Method Details
-
performFinalize
The following initialization is performed:- Initializes component options for empty table message
- Specified by:
performFinalizein interfaceLifecycleElement- Overrides:
performFinalizein classComponentBase- Parameters:
model- - top level object containing the dataparent- - parent component
-
buildTableOptions
Builds column options for sorting- Parameters:
collectionGroup-
-
buildSortOptions
Builds default sorting options.- Parameters:
lookupView- the view for the lookupcollectionGroup- the collection group for the table
-
getDataFieldColumnOptions
protected String getDataFieldColumnOptions(int target, CollectionGroup collectionGroup, DataField field) Construct the column options for a data field- Parameters:
target- column indexcollectionGroup- the collectionGroup in which the data field is definedfield- the field to construction options for- Returns:
- options as valid for datatable
-
constructTableColumnOptions
public String constructTableColumnOptions(int target, boolean isSortable, boolean isUseServerPaging, Class<?> dataTypeClass, String sortDataType) Constructs the sort data type for each data table columns in a format that will be used to initialize the data table widget via javascript- Parameters:
target- the column indexisSortable- whether a column should be marked as sortableisUseServerPaging- is server side paging enabled?dataTypeClass- the class type of the column value - used determine the sType option - which identifies the search plugin to usesortDataType- Defines a data source type for the sorting which can be used to read realtime information from the table- Returns:
- a formatted string with data table options for one column
-
getEmptyTableMessage
Returns the text which is used to display text when the table is empty- Returns:
- empty table message
-
setEmptyTableMessage
Setter for a text to be displayed when the table is empty- Parameters:
emptyTableMessage-
-
isDisableTableSort
public boolean isDisableTableSort()Returns true if sorting is disabled- Returns:
- the disableTableSort
-
setDisableTableSort
public void setDisableTableSort(boolean disableTableSort) Enables/disables the table sorting- Parameters:
disableTableSort- the disableTableSort to set
-
isShowExportOption
public boolean isShowExportOption()Returns true if export option is enabled- Returns:
- the showExportOption
-
setShowExportOption
public void setShowExportOption(boolean showExportOption) Show/Hide the search and export option in tabletools- Parameters:
showExportOption- the showExportOptions to set
-
getHiddenColumns
Holds propertyNames for the ones meant to be hidden since columns are visible by defaultDuplicate entries are ignored and the order of entries is not significant
- Returns:
- a set with propertyNames of columns to be hidden
-
setHiddenColumns
Setter for the hidden columns set- Parameters:
hiddenColumns- a set containing propertyNames
-
getSortableColumns
Holds the propertyNames for columns that are to be sortedDuplicate entries are ignored and the order of entries is not significant
- Returns:
- a set of propertyNames with for columns that will be sorted
-
setSortableColumns
Setter for sortable columns- Parameters:
sortableColumns- a set containing propertyNames of columns to be sorted
-
getAjaxSource
Specifies a URL for acquiring the table data with ajaxWhen the ajax source URL is specified the rich table plugin will retrieve the data by invoking the URL and building the table rows from the result. This is different from the standard use of the rich table plugin with uses progressive enhancement to decorate a table that has already been rendereed
- Returns:
- URL for ajax source
-
setAjaxSource
Setter for the Ajax source URL- Parameters:
ajaxSource-
-
getGroupingOptionsJSString
Get groupingOption- Returns:
- grouping options as a JS string
-
setGroupingOptionsJSString
Set the groupingOptions js data. This should not be set through XML configuration.- Parameters:
groupingOptionsJSString-
-
isForceAoColumnDefsOverride
public boolean isForceAoColumnDefsOverride()If set to true and the aoColumnDefs template option is explicitly defined in templateOptions, those aoColumnDefs will be used for this table. Otherwise, if false, the aoColumnDefs will attempt to be merged with those that are automatically generated by RichTable- Returns:
- true if the aoColumnDefs set will completely override those that are generated automatically by RichTable
-
setForceAoColumnDefsOverride
public void setForceAoColumnDefsOverride(boolean forceAoColumnDefsOverride) Set forceAoColumnDefsOverride- Parameters:
forceAoColumnDefsOverride-
-
isForceLocalJsonData
public boolean isForceLocalJsonData()If true, the table will automatically use row JSON data generated by this widgetThis forces the table backed by this RichTable to get its content from a template option called aaData. This will automatically skip row generation in the template, and cause the table receive its data from the aaData template option automatically generated and set by this RichTable. This allows the table to take advantage of the bDeferRender option (also automatically set to true) when this table is a paged table (performance increase for tables that are more than one page). Note: the CollectionGroup's isUseServerPaging flag will always override this functionality if it is also true.
- Returns:
- true if backed by the aaData option in JSON, that is generated during the ftl rendering process by this widget for this table
-
setForceLocalJsonData
public void setForceLocalJsonData(boolean forceLocalJsonData) Set the forceLocalJsonData flag to force this table to use generated row json data- Parameters:
forceLocalJsonData-
-
getNestedLevel
public int getNestedLevel()The nestedLevel property represents how many collection tables deep this particular table isThis property must be manually set if the flag forceLocalJsonData is being used and the collection table this RichTable represents is a subcollection of a TABLE collection (not stacked collection). If this is true, add 1 for each level deep (ex. subCollection would be 1, sub-subCollection would be 2). If this property is not set javascript errors will occur on the page, as this determines how deep to escape certain characters.
- Returns:
- the nestedLevel representing the
-
setNestedLevel
public void setNestedLevel(int nestedLevel) Set the nestedLevel for this table - must be set if using forceLocalJsonData and this is a subCollection of a TableCollection (also using forceLocalJsonData)- Parameters:
nestedLevel-
-
getAaData
Get the translated aaData array generated by calls to addRowToTableData by the ftlThis data is in JSON format and expected to be consumed by datatables when utilizing the forceLocalJsonData option. This will be populated automatically if that flag is set to true.
- Returns:
- the generated aaData
-
setAaData
Set the translated aaData arrayThis data is in JSON format and expected to be consumed by datatables when utilizing the forceLocalJsonData. This setter is required for copyProperties()
- Parameters:
aaData- the generated aaData
-
getCellValue
Get the simple value as a string that represents the field's sortable value, to be used as val in the custom uif json data object (accessed by mDataProp option on datatables - automated by framework) when using the forceLocalJsonData option or the CollectionGroup's isUseServerPaging option- Parameters:
model- model the current modelfield- the field to retrieve a sortable value from for use in custom json data- Returns:
- the value as a String
-
addRowToTableData
Add row content passed from table ftl to the aaData array by converting and escaping the content to an object (in an array of objects) in JSON formatThe data in aaData is expected to be consumed by a call by the datatables plugin using sAjaxSource or aaData. The addRowToTableData generation call is additive must be made per a row in the ftl.
- Parameters:
row- the row of content with each cell content surrounded by the @quot@ token and followed by a comma
-
getConfigurationService
-