org.kuali.rice.krad.uif.container
Class LightTable

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.container.ContainerBase
                  extended by org.kuali.rice.krad.uif.container.Group
                      extended by org.kuali.rice.krad.uif.container.LightTable
All Implemented Interfaces:
Serializable, Copyable, DictionaryBean, UifDictionaryBean, Component, DataBinding, ScriptEventSupport, Container, LifecycleElement, Helpable, org.springframework.core.Ordered

public class LightTable
extends Group
implements DataBinding

LightTable is a light-weight collection table implementation that supports a subset of features, Current known supported features are:

Other features are not guaranteed to work, but may work at your own risk. The intent of this table is to be a light-weight alternative to the fully featured table already available in KRAD and it is more suited to displaying large sets of simple data to the user.

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

Field Summary
 
Fields inherited from class org.kuali.rice.krad.uif.component.ComponentBase
templateOptions
 
Fields inherited from class org.kuali.rice.krad.datadictionary.DictionaryBeanBase
componentCode, namespaceCode
 
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
LightTable()
          LightTable constructor
 
Method Summary
protected  Map<String,String> addChildExpressions(List<? extends Component> components, Map<String,String> expressionMap)
          Add expressions to the expression map for nested components of specific types
protected  Map<String,String> buildExpressionMap(Component item, Map<String,String> expressionMap)
          Builds the expression map which contains "propertyName@@@id" and the expression.
 void buildRows(View view, String rowTemplate, UifFormBase model)
          Build the rows from the rowTemplate passed in.
protected
<T> void
copyProperties(T component)
          Copies properties for copy()
protected  String evaluateAndReplaceExpressionValues(String row, int index, Object model, Map<String,Object> expandedContext, Pattern expressionPattern, ExpressionEvaluator expressionEvaluator)
          Evaluate expressions and replace content found by the expressionPattern in the row
protected  String evaluateRenderExpressions(String row, int index, Object model, Map<String,Object> expandedContext, ExpressionEvaluator expressionEvaluator)
          Evaluates the render expressions for the row and removes the content if render is evaluated false
 BindingInfo getBindingInfo()
          The bindingInfo for this collection table, containg the property path and other options
 List<Component> getComponentsForLifecycle()
          List of components that are contained within the component and should be sent through the lifecycle
 Map<String,String> getConditionalRowCssClasses()
          The row css classes for the rows of this layout
protected  String getCurrentColumnValue()
           
 Map<String,String> getExpressionConversionMap()
           
 List<Label> getHeaderLabels()
          The labels for the header derived from the items of this collection (the fields)
 List<String> getInitialComponentIds()
           
 String getPropertyName()
          The propertyName of the list backing this collection
 Map<String,String> getRenderIdExpressionMap()
           
 RichTable getRichTable()
          The richTable widget definition for this table for setting dataTable javascript options
protected  String handleDataFieldInRow(Component item, Object obj, String row, int index, String originalId)
          Special handling of the DataField in the row, replaces necessary content with row specific content
protected  String handleInputFieldInRow(Component item, Object obj, String row, int index, String originalId)
          Special handling of the InputField in the row, replaces necessary content with row specific content
 boolean isEmptyTable()
          True if this table is empty, false otherwise
 void performFinalize(Object model, Component parent)
          performFinalize override corrects the binding path for the DataFields and turns off rendering on some components
 void performInitialization(Object model)
          Initialization override that sets up DataField value placeholders for parsing and populates the expressionConversionMap
 void processExpression(String name, Component item, Map<String,String> expressionMap, List<String> toRemove)
          Process the expression for the item by putting placeholder values in for String properties and adding markers for render expressions to the component; adds the original expression to the expressionMap
 void setBindingInfo(BindingInfo bindingInfo)
          Set the bindingInfo
 void setConditionalRowCssClasses(Map<String,String> conditionalRowCssClasses)
          Set the conditionalRowCssClasses
protected  void setCurrentColumnValue(String currentColumnValue)
          Set the current column value
 void setEmptyTable(boolean emptyTable)
           
 void setExpressionConversionMap(Map<String,String> expressionConversionMap)
           
 void setHeaderLabels(List<Label> headerLabels)
           
 void setInitialComponentIds(List<String> initialComponentIds)
           
 void setPropertyName(String propertyName)
          Set the propertyName
 void setRenderIdExpressionMap(Map<String,String> renderIdExpressionMap)
           
 void setRichTable(RichTable richTable)
          Set the richTable widget
 
Methods inherited from class org.kuali.rice.krad.uif.container.Group
completeValidation, getComponentTypeName, getDisclosure, getFieldBindByNamePrefix, getFieldBindingObjectPath, getItems, getScrollpane, getSupportedComponents, isRenderLoading, setDisclosure, setFieldBindByNamePrefix, setFieldBindingObjectPath, setItems, setScrollpane
 
Methods inherited from class org.kuali.rice.krad.uif.container.ContainerBase
getComponentPrototypes, getDefaultItemPosition, getFooter, getHeader, getHeaderText, getHelp, getHelpTitle, getInstructionalMessage, getInstructionalText, getLayoutManager, getValidationMessages, initializePendingTasks, performApplyModel, setDefaultItemPosition, setFooter, setHeader, setHeaderText, setHelp, setInstructionalMessage, setInstructionalText, setLayoutManager, setRenderFooter, setRenderHeader, setTooltipOfComponent, setValidationMessages, sortItems
 
Methods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addCellCssClass, addDataAttribute, addDataAttributeIfNonEmpty, addStyleClass, allowModification, appendToStyle, checkMutable, clearLastPhase, copy, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellStyleClassesAsString, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getId, getLastPhase, 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, getViewStatus, getWidth, initializeComponentSecurity, isDisableSessionPersistence, isDisclosedByAction, isEditAuthz, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isMutable, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, isSkipInTabOrder, isViewAuthz, pushAllToContext, pushObjectToContext, pushToPropertyReplacerContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setEditAuthz, 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, setViewAuthz, setViewStatus, setViewStatus, 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
dataDictionaryPostProcessing, 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, clearLastPhase, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, getAlign, getBaseId, getCellCssClasses, getCellStyle, getCellWidth, getColSpan, getComponentModifiers, getComponentSecurity, getConditionalRefresh, getConditionalRefreshConditionJs, getConditionalRefreshControlNames, getContext, getCssClasses, getDataAttributes, getEventHandlerScript, getFinalizeMethodAdditionalArguments, getFinalizeMethodInvoker, getFinalizeMethodToCall, getLastPhase, getLibraryCssClasses, getOrder, getPostRenderContent, getPreRenderContent, getProgressiveDisclosureConditionJs, getProgressiveDisclosureControlNames, getProgressiveRender, getPropertyReplacerComponents, getPropertyReplacers, getRefreshTimer, getRefreshWhenChangedPropertyNames, getRenderedHtmlOutput, getRequired, getRowSpan, getSimpleDataAttributes, getStyle, getTemplate, getTemplateName, getTemplateOptions, getTemplateOptionsJSString, getTitle, getToolTip, getValign, getViewStatus, getWidth, isDisableSessionPersistence, isDisclosedByAction, isFinal, isForceSessionPersistence, isHidden, isInitialized, isModelApplied, isProgressiveRenderAndRefresh, isProgressiveRenderViaAJAX, isReadOnly, isRefreshedByAction, isRender, isRendered, isResetDataOnRefresh, isRetrieveViaAjax, isSelfRendered, pushAllToContext, pushObjectToContext, setAdditionalComponentsToRefresh, setAdditionalCssClasses, setAlign, setBaseId, setCellCssClasses, setCellStyle, setCellWidth, setColSpan, setComponentModifiers, setComponentSecurity, setConditionalRefresh, setContext, setCssClasses, setDataAttributes, setDisableSessionPersistence, setDisclosedByAction, setForceSessionPersistence, setHidden, 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, setViewStatus, setViewStatus, 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
dataDictionaryPostProcessing, getComponentCode, getNamespaceCode
 
Methods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, copy, getId, isMutable, setId
 
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

LightTable

public LightTable()
LightTable constructor

Method Detail

performInitialization

public void performInitialization(Object model)
Initialization override that sets up DataField value placeholders for parsing and populates the expressionConversionMap

Specified by:
performInitialization in interface LifecycleElement
Overrides:
performInitialization in class Group
Parameters:
model - - object instance containing the view data
See Also:
org.kuali.rice.krad.uif.component.ComponentBase#performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object)

buildExpressionMap

protected Map<String,String> buildExpressionMap(Component item,
                                                Map<String,String> expressionMap)
Builds the expression map which contains "propertyName@@@id" and the expression. Also fills the renderIdExpressionMap which contains all the component ids and expressions for render conditions, and overrides ids with a placeholder id. This method is recursive for child components which match certain supported types.

Parameters:
item - the item to iterate on
expressionMap - the map holding the expressions for the items of this collection
Returns:
the expressionMap with expressions populated

processExpression

public void processExpression(String name,
                              Component item,
                              Map<String,String> expressionMap,
                              List<String> toRemove)
Process the expression for the item by putting placeholder values in for String properties and adding markers for render expressions to the component; adds the original expression to the expressionMap

Parameters:
name - the property name
item - the component this expressio is on
expressionMap - the map to add expressions to
toRemove - the property name is added this map to be removed later

addChildExpressions

protected Map<String,String> addChildExpressions(List<? extends Component> components,
                                                 Map<String,String> expressionMap)
Add expressions to the expression map for nested components of specific types

Parameters:
components - the child components
expressionMap - the map to add expressions to
Returns:
the map with child component expressions added

performFinalize

public void performFinalize(Object model,
                            Component parent)
performFinalize override corrects the binding path for the DataFields and turns off rendering on some components

Specified by:
performFinalize in interface LifecycleElement
Overrides:
performFinalize in class ContainerBase
Parameters:
model - - top level object containing the data
parent - - parent component
See Also:
org.kuali.rice.krad.uif.component.ComponentBase#performFinalize(org.kuali.rice.krad.uif.view.View, java.lang.Object, org.kuali.rice.krad.uif.component.Component)

getComponentsForLifecycle

public List<Component> getComponentsForLifecycle()
Description copied from interface: Component
List of components that are contained within the component and should be sent through the lifecycle

Used by ViewHelperService for the various lifecycle callbacks

Specified by:
getComponentsForLifecycle in interface Component
Overrides:
getComponentsForLifecycle in class Group
Returns:
List child components
See Also:
Component.getComponentsForLifecycle()

buildRows

public void buildRows(View view,
                      String rowTemplate,
                      UifFormBase model)
Build the rows from the rowTemplate passed in. This method uses regex to locate pieces of the row that need to be replaced with row specific content per row.

Parameters:
view - the view instance the table is being built within
rowTemplate - the first row of the collection in html generated from the ftl
model - the model

evaluateAndReplaceExpressionValues

protected String evaluateAndReplaceExpressionValues(String row,
                                                    int index,
                                                    Object model,
                                                    Map<String,Object> expandedContext,
                                                    Pattern expressionPattern,
                                                    ExpressionEvaluator expressionEvaluator)
Evaluate expressions and replace content found by the expressionPattern in the row

Parameters:
row - the row being modified
index - the line index
model - the model
expandedContext - the context to evaluate expressions against
expressionPattern - the expression pattern used to find expression tokens for value replacement
expressionEvaluator - the expression service to use for evaluation
Returns:
the modified row

evaluateRenderExpressions

protected String evaluateRenderExpressions(String row,
                                           int index,
                                           Object model,
                                           Map<String,Object> expandedContext,
                                           ExpressionEvaluator expressionEvaluator)
Evaluates the render expressions for the row and removes the content if render is evaluated false

Parameters:
row - the row being modified
index - the line index
model - the model
expandedContext - the context to evaluate expressions against
expressionEvaluator - the expression service to use for evaluation
Returns:
the modified row

handleDataFieldInRow

protected String handleDataFieldInRow(Component item,
                                      Object obj,
                                      String row,
                                      int index,
                                      String originalId)
Special handling of the DataField in the row, replaces necessary content with row specific content

Parameters:
item - the item being processed
obj - the row's object model
row - the row in html
index - the current row index
originalId - the original id of the component item
Returns:
the updated row

handleInputFieldInRow

protected String handleInputFieldInRow(Component item,
                                       Object obj,
                                       String row,
                                       int index,
                                       String originalId)
Special handling of the InputField in the row, replaces necessary content with row specific content

Parameters:
item - the item being processed
obj - the row's object model
row - the row in html
index - the current row index
originalId - the original id of the component item
Returns:
the updated row

getPropertyName

public String getPropertyName()
The propertyName of the list backing this collection

Specified by:
getPropertyName in interface DataBinding
Returns:
the propertyName of this collection

setPropertyName

public void setPropertyName(String propertyName)
Set the propertyName

Parameters:
propertyName -

getBindingInfo

public BindingInfo getBindingInfo()
The bindingInfo for this collection table, containg the property path and other options

Specified by:
getBindingInfo in interface DataBinding
Returns:
the bindingInfo
See Also:
BindingInfo

setBindingInfo

public void setBindingInfo(BindingInfo bindingInfo)
Set the bindingInfo

Specified by:
setBindingInfo in interface DataBinding
Parameters:
bindingInfo -

getHeaderLabels

public List<Label> getHeaderLabels()
The labels for the header derived from the items of this collection (the fields)

Returns:
the header labels

getRichTable

public RichTable getRichTable()
The richTable widget definition for this table for setting dataTable javascript options

Returns:
the RichTable widget

setRichTable

public void setRichTable(RichTable richTable)
Set the richTable widget

Parameters:
richTable -

getConditionalRowCssClasses

public Map<String,String> getConditionalRowCssClasses()
The row css classes for the rows of this layout

To set a css class on all rows, use "all" as a key. To set a class for even rows, use "even" as a key, for odd rows, use "odd". Use a one-based index to target a specific row by index. SpringEL can be used as a key and the expression will be evaluated; if evaluated to true, the class(es) specified will be applied.

Returns:
a map which represents the css classes of the rows of this layout

setConditionalRowCssClasses

public void setConditionalRowCssClasses(Map<String,String> conditionalRowCssClasses)
Set the conditionalRowCssClasses

Parameters:
conditionalRowCssClasses -

isEmptyTable

public boolean isEmptyTable()
True if this table is empty, false otherwise

Returns:
true if the collection backing this table is empty

setHeaderLabels

public void setHeaderLabels(List<Label> headerLabels)

setExpressionConversionMap

public void setExpressionConversionMap(Map<String,String> expressionConversionMap)

getExpressionConversionMap

public Map<String,String> getExpressionConversionMap()

getInitialComponentIds

public List<String> getInitialComponentIds()

getRenderIdExpressionMap

public Map<String,String> getRenderIdExpressionMap()

setInitialComponentIds

public void setInitialComponentIds(List<String> initialComponentIds)

setRenderIdExpressionMap

public void setRenderIdExpressionMap(Map<String,String> renderIdExpressionMap)

setEmptyTable

public void setEmptyTable(boolean emptyTable)

getCurrentColumnValue

protected String getCurrentColumnValue()
Returns:
the current column value

setCurrentColumnValue

protected void setCurrentColumnValue(String currentColumnValue)
Set the current column value

Parameters:
currentColumnValue -

copyProperties

protected <T> void copyProperties(T component)
Description copied from class: DictionaryBeanBase
Copies properties for copy()

Overrides:
copyProperties in class Group
Parameters:
component - base bean
See Also:
DictionaryBeanBase.copyProperties(Object)


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