org.kuali.rice.krad.uif.widget
Class RichTable

java.lang.Object
  extended by org.kuali.rice.krad.datadictionary.DictionaryBeanBase
      extended by org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
          extended by org.kuali.rice.krad.uif.component.ComponentBase
              extended by org.kuali.rice.krad.uif.widget.WidgetBase
                  extended by org.kuali.rice.krad.uif.widget.RichTable
All Implemented Interfaces:
Serializable, Cloneable, DictionaryBean, UifDictionaryBean, Component, ScriptEventSupport, Widget, org.springframework.core.Ordered

public class RichTable
extends WidgetBase

Decorates a HTML Table client side with various tools

Decorations implemented depend on widget implementation. Examples are sorting, paging and skinning.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.kuali.rice.krad.uif.component.Ordered
INITIAL_ORDER_VALUE
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
RichTable()
           
 
Method Summary
 void addRowToTableData(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 format
protected  void buildTableOptions(CollectionGroup collectionGroup)
          Builds column options for sorting
 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
protected
<T> void
copyProperties(T component)
          Copies the properties over for the copy method
 String getAaData()
          Get the translated aaData array generated by calls to addRowToTableData by the ftl
 String getAjaxSource()
          Specifies a URL for acquiring the table data with ajax
 String getCellValue(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 option
protected  ConfigurationService getConfigurationService()
           
protected  String getDataFieldColumnOptions(int target, CollectionGroup collectionGroup, DataField field)
          Construct the column options for a data field
 String getEmptyTableMessage()
          Returns the text which is used to display text when the table is empty
 String getGroupingOptionsJSString()
          Get groupingOption
 Set<String> getHiddenColumns()
          Holds propertyNames for the ones meant to be hidden since columns are visible by default
 int getNestedLevel()
          The nestedLevel property represents how many collection tables deep this particular table is
 Set<String> getSortableColumns()
          Holds the propertyNames for columns that are to be sorted
 boolean isDisableTableSort()
          Returns true if sorting is disabled
 boolean isForceAoColumnDefsOverride()
          If set to true and the aoColumnDefs template option is explicitly defined in templateOptions, those aoColumnDefs will be used for this table.
 boolean isForceLocalJsonData()
          If true, the table will automatically use row JSON data generated by this widget
 boolean isShowExportOption()
          Returns true if export option is enabled
 boolean isShowSearchAndExportOptions()
          Returns true if search and export options are enabled
 boolean isShowSearchOption()
          Returns true if search option is enabled
 void performFinalize(View view, Object model, Component component)
          The following initialization is performed: Initializes component options for empty table message
 void setAaData(String aaData)
          Set the translated aaData array
 void setAjaxSource(String ajaxSource)
          Setter for the Ajax source URL
 void setDisableTableSort(boolean disableTableSort)
          Enables/disables the table sorting
 void setEmptyTableMessage(String emptyTableMessage)
          Setter for a text to be displayed when the table is empty
 void setForceAoColumnDefsOverride(boolean forceAoColumnDefsOverride)
          Set forceAoColumnDefsOverride
 void setForceLocalJsonData(boolean forceLocalJsonData)
          Set the forceLocalJsonData flag to force this table to use generated row json data
 void setGroupingOptionsJSString(String groupingOptionsJSString)
          Set the groupingOptions js data.
 void setHiddenColumns(Set<String> hiddenColumns)
          Setter for the hidden columns set
 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)
 void setShowExportOption(boolean showExportOption)
          Show/Hide the search and export option in tabletools
 void setShowSearchAndExportOptions(boolean showSearchAndExportOptions)
          Show/Hide the search and export options in tabletools.
 void setShowSearchOption(boolean showSearchOption)
          Show/Hide the search option in tabletools
 void setSortableColumns(Set<String> sortableColumns)
          Setter for sortable columns
 
Methods inherited from class org.kuali.rice.krad.uif.widget.WidgetBase
getComponentTypeName
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, appendToStyle, completeValidation, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentSecurityClass, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getMethodToCallOnRefresh, getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getStyleClassesAsString, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setFinalizeMethodAdditionalArguments, setFinalizeMethodInvoker, setFinalizeMethodToCall, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setMethodToCallOnRefresh, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setSelfRendered, setSkipInTabOrder, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from class org.kuali.rice.krad.datadictionary.uif.UifDictionaryBeanBase
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
getComponentCode, getNamespaceCode, setComponentCode, setNamespaceCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.krad.uif.component.Component
addCellCssClass, addDataAttribute, addStyleClass, appendToStyle, completeValidation, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComponentModifiers, getComponentPrototypes, getComponentSecurity, getComponentsForLifecycle, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLibraryCssClasses, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getWidth, isDisableSessionPersistence, isDisclosedByAction, isForceSessionPersistence, isHidden, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, performApplyModel, performInitialization, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, setId, setLibraryCssClasses, setOrder, setPostRenderContent, setPreRenderContent, setProgressiveRender, setProgressiveRenderAndRefresh, setProgressiveRenderViaAJAX, setPropertyReplacers, setReadOnly, setRefreshedByAction, setRefreshTimer, setRefreshWhenChangedPropertyNames, setRender, setRenderedHtmlOutput, setRequired, setResetDataOnRefresh, setRetrieveViaAjax, setRowSpan, setSelfRendered, setStyle, setTemplate, setTemplateName, setTemplateOptions, setTemplateOptionsJSString, setTitle, setToolTip, setValign, setWidth
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.uif.UifDictionaryBean
getExpressionGraph, getPropertyExpression, getPropertyExpressions, getRefreshExpressionGraph, setExpressionGraph, setPropertyExpressions, setRefreshExpressionGraph
 
Methods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.component.ScriptEventSupport
getOnBlurScript, getOnChangeScript, getOnClickScript, getOnCloseScript, getOnDblClickScript, getOnDocumentReadyScript, getOnFocusScript, getOnKeyDownScript, getOnKeyPressScript, getOnKeyUpScript, getOnLoadScript, getOnMouseDownScript, getOnMouseMoveScript, getOnMouseOutScript, getOnMouseOverScript, getOnMouseUpScript, getOnSubmitScript, getOnUnloadScript, setOnBlurScript, setOnChangeScript, setOnClickScript, setOnCloseScript, setOnDblClickScript, setOnDocumentReadyScript, setOnFocusScript, setOnKeyDownScript, setOnKeyPressScript, setOnKeyUpScript, setOnLoadScript, setOnMouseDownScript, setOnMouseMoveScript, setOnMouseOutScript, setOnMouseOverScript, setOnMouseUpScript, setOnSubmitScript, setOnUnloadScript
 

Constructor Detail

RichTable

public RichTable()
Method Detail

performFinalize

public void performFinalize(View view,
                            Object model,
                            Component component)
The following initialization is performed:

Specified by:
performFinalize in interface Component
Overrides:
performFinalize in class ComponentBase
Parameters:
view - - view instance that should be finalized for rendering
model - - top level object containing the data
component - - parent component
See Also:
Component.performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

buildTableOptions

protected void buildTableOptions(CollectionGroup collectionGroup)
Builds column options for sorting

Parameters:
collectionGroup -

getDataFieldColumnOptions

protected String getDataFieldColumnOptions(int target,
                                           CollectionGroup collectionGroup,
                                           DataField field)
Construct the column options for a data field

Parameters:
collectionGroup - the collectionGroup in which the data field is defined
field - 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 index
isSortable - whether a column should be marked as sortable
isUseServerPaging - is server side paging enabled?
dataTypeClass - the class type of the column value - used determine the sType option - which identifies the search plugin to use
sortDataType - 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

public String getEmptyTableMessage()
Returns the text which is used to display text when the table is empty

Returns:
empty table message

setEmptyTableMessage

public void setEmptyTableMessage(String emptyTableMessage)
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

isShowSearchAndExportOptions

public boolean isShowSearchAndExportOptions()
Returns true if search and export options are enabled

Returns:
the showSearchAndExportOptions

isShowSearchOption

public boolean isShowSearchOption()
Returns true if search option is enabled

Returns:
the showSearchOption

isShowExportOption

public boolean isShowExportOption()
Returns true if export option is enabled

Returns:
the showExportOption

setShowSearchAndExportOptions

public void setShowSearchAndExportOptions(boolean showSearchAndExportOptions)
Show/Hide the search and export options in tabletools. This option supercedes the individual 'show search' option and 'show export' option

Parameters:
showSearchAndExportOptions - the showSearchAndExportOptions to set

setShowSearchOption

public void setShowSearchOption(boolean showSearchOption)
Show/Hide the search option in tabletools

Parameters:
showSearchOption - the showSearchOptions to set

setShowExportOption

public void setShowExportOption(boolean showExportOption)
Show/Hide the search and export option in tabletools

Parameters:
showExportOption - the showExportOptions to set

getHiddenColumns

public Set<String> getHiddenColumns()
Holds propertyNames for the ones meant to be hidden since columns are visible by default

Duplicate entries are ignored and the order of entries is not significant

Returns:
a set with propertyNames of columns to be hidden

setHiddenColumns

public void setHiddenColumns(Set<String> hiddenColumns)
Setter for the hidden columns set

Parameters:
hiddenColumns - a set containing propertyNames

getSortableColumns

public Set<String> getSortableColumns()
Holds the propertyNames for columns that are to be sorted

Duplicate entries are ignored and the order of entries is not significant

Returns:
a set of propertyNames with for columns that will be sorted

setSortableColumns

public void setSortableColumns(Set<String> sortableColumns)
Setter for sortable columns

Parameters:
sortableColumns - a set containing propertyNames of columns to be sorted

getAjaxSource

public String getAjaxSource()
Specifies a URL for acquiring the table data with ajax

When 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

public void setAjaxSource(String ajaxSource)
Setter for the Ajax source URL

Parameters:
ajaxSource -

getGroupingOptionsJSString

public String getGroupingOptionsJSString()
Get groupingOption

Returns:

setGroupingOptionsJSString

public void setGroupingOptionsJSString(String groupingOptionsJSString)
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 widget

This 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 is

This 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

public String getAaData()
Get the translated aaData array generated by calls to addRowToTableData by the ftl

This 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

public void setAaData(String aaData)
Set the translated aaData array

This data is in JSON format and expected to be consumed by datatables when utilizing the forceLocalJsonData. This setter is required for copyProperties()


getCellValue

public String getCellValue(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 option

Parameters:
model - model the current model
field - the field to retrieve a sortable value from for use in custom json data
Returns:
the value as a String

addRowToTableData

public void addRowToTableData(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 format

The 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

protected ConfigurationService getConfigurationService()

copyProperties

protected <T> void copyProperties(T component)
Description copied from class: ComponentBase
Copies the properties over for the copy method

Overrides:
copyProperties in class WidgetBase
Parameters:
component - base bean
See Also:
ComponentBase.copy()


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.