Class LightTable
- All Implemented Interfaces:
Serializable,Cloneable,Copyable,DictionaryBean,UifDictionaryBean,Component,DataBinding,Ordered,ScriptEventSupport,Container,Group,LifecycleElement,Helpable,org.springframework.core.Ordered
LightTable is a light-weight collection table implementation that supports a subset of features,
Current known supported features are:
- DataField
- InputField with TextControl, CheckboxControl, or single SelectControl
- MessageField
- LinkField
- ActionField
- ImageField
- most RichTable options
- FieldGroup containing only Actions, Image, Messages, or Links
- SpringEL for String properties on supported components only
- SpringEL specifically for the render property
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.kuali.rice.krad.uif.container.GroupBase
GroupBase.ACTION_VALIDATION_COMPONENTS -
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 TypeMethodDescriptionaddChildExpressions(Collection<? extends LifecycleElement> components, Map<String, String> expressionMap) Add expressions to the expression map for nested components of specific typesbuildExpressionMap(Component item, Map<String, String> expressionMap) Builds the expression map which contains "propertyName@@@id" and the expression.voidbuildRows(View view, String rowTemplate, UifFormBase model) Build the rows from the rowTemplate passed in.protected StringevaluateAndReplaceExpressionValues(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 rowprotected StringevaluateRenderExpressions(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 falseThe bindingInfo for this collection table, containg the property path and other optionsThe row css classes for the rows of this layoutprotected StringThe labels for the header derived from the items of this collection (the fields)The propertyName of the list backing this collectionThe richTable widget definition for this table for setting dataTable javascript optionsprotected StringhandleDataFieldInRow(Component item, Object obj, String row, int index, String originalId) Special handling of the DataField in the row, replaces necessary content with row specific contentprotected StringhandleInputFieldInRow(Component item, Object obj, String row, int index, String originalId) Special handling of the InputField in the row, replaces necessary content with row specific contentbooleanTrue if this table is empty, false otherwisevoidperformFinalize(Object model, LifecycleElement parent) performFinalize override corrects the binding path for the DataFields and turns off rendering on some componentsvoidperformInitialization(Object model) Initialization override that sets up DataField value placeholders for parsing and populates the expressionConversionMapvoidprocessExpression(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 expressionMapvoidsetBindingInfo(BindingInfo bindingInfo) Set the bindingInfovoidsetConditionalRowCssClasses(Map<String, String> conditionalRowCssClasses) Set the conditionalRowCssClassesprotected voidsetCurrentColumnValue(String currentColumnValue) Set the current column valuevoidsetEmptyTable(boolean emptyTable) voidsetExpressionConversionMap(Map<String, String> expressionConversionMap) voidsetHeaderLabels(List<Label> headerLabels) voidsetInitialComponentIds(List<String> initialComponentIds) voidsetPropertyName(String propertyName) Set the propertyNamevoidsetRenderIdExpressionMap(Map<String, String> renderIdExpressionMap) voidsetRichTable(RichTable richTable) Set the richTable widgetMethods inherited from class org.kuali.rice.krad.uif.container.GroupBase
afterEvaluateExpression, buildInputFieldValidationActionScript, completeValidation, getComponentTypeName, getDisclosure, getFieldBindByNamePrefix, getFieldBindingObjectPath, getItems, getScrollpane, getSupportedComponents, getWrapperTag, isAjaxDisclosureGroup, isRenderLoading, setDisclosure, setFieldBindByNamePrefix, setFieldBindingObjectPath, setItems, setNestedComponentId, setScrollpane, setupValidationScripts, setWrapperTag, validateInputFieldMethods inherited from class org.kuali.rice.krad.uif.container.ContainerBase
getAdditionalTemplates, getDefaultItemPosition, getEnterKeyAction, getFooter, getHeader, getHeaderText, getHelp, getHelpTitle, getInstructionalMessage, getInstructionalText, getLayoutManager, getValidationMessages, isProcessRemoteFieldHolders, performApplyModel, setDefaultItemPosition, setEnterKeyAction, setFooter, setHeader, setHeaderText, setHelp, setInstructionalMessage, setInstructionalText, setLayoutManager, setRenderFooter, setRenderHeader, setTooltipOfComponent, setValidationMessages, sortItemsMethods inherited from class org.kuali.rice.krad.uif.component.ComponentBase
addAriaAttribute, addDataAttribute, addScriptDataAttribute, addStyleClass, addWrapperCssClass, appendToStyle, checkMutable, clone, getAdditionalComponentsToRefresh, getAdditionalComponentsToRefreshJs, getAdditionalCssClasses, 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, 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, getComponentTypeName, 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.uif.container.Container
getEnterKeyAction, getFooter, getHeader, getInstructionalMessage, getLayoutManager, getValidationMessages, isProcessRemoteFieldHolders, setEnterKeyAction, setFooter, setHeader, setInstructionalMessage, setLayoutManager, setValidationMessages, sortItemsMethods inherited from interface org.kuali.rice.krad.datadictionary.DictionaryBean
dataDictionaryPostProcessing, getComponentCode, getNamespaceCodeMethods inherited from interface org.kuali.rice.krad.uif.container.Group
getHeaderText, setHeaderText, setRenderFooterMethods inherited from interface org.kuali.rice.krad.uif.widget.Helpable
getHelp, getHelpTitle, setHelp, setTooltipOfComponentMethods inherited from interface org.kuali.rice.krad.uif.util.LifecycleElement
checkMutable, getContainerIdSuffix, getId, getPhasePathMapping, getViewPath, getViewStatus, isFinal, isInitialized, isModelApplied, isMutable, isRender, notifyCompleted, performApplyModel, 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
-
LightTable
public LightTable()LightTable constructor
-
-
Method Details
-
performInitialization
Initialization override that sets up DataField value placeholders for parsing and populates the expressionConversionMap- Specified by:
performInitializationin interfaceLifecycleElement- Overrides:
performInitializationin classGroupBase- Parameters:
model- - object instance containing the view data- See Also:
-
buildExpressionMap
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 onexpressionMap- 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 nameitem- the component this expressio is onexpressionMap- the map to add expressions totoRemove- the property name is added this map to be removed later
-
addChildExpressions
protected Map<String,String> addChildExpressions(Collection<? extends LifecycleElement> components, Map<String, String> expressionMap) Add expressions to the expression map for nested components of specific types- Parameters:
components- the child componentsexpressionMap- the map to add expressions to- Returns:
- the map with child component expressions added
-
performFinalize
performFinalize override corrects the binding path for the DataFields and turns off rendering on some components- Specified by:
performFinalizein interfaceLifecycleElement- Overrides:
performFinalizein classGroupBase- Parameters:
model- - top level object containing the dataparent- - parent component
-
buildRows
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 withinrowTemplate- the first row of the collection in html generated from the ftlmodel- 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 modifiedindex- the line indexmodel- the modelexpandedContext- the context to evaluate expressions againstexpressionPattern- the expression pattern used to find expression tokens for value replacementexpressionEvaluator- 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 modifiedindex- the line indexmodel- the modelexpandedContext- the context to evaluate expressions againstexpressionEvaluator- 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 processedobj- the row's object modelrow- the row in htmlindex- the current row indexoriginalId- 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 processedobj- the row's object modelrow- the row in htmlindex- the current row indexoriginalId- the original id of the component item- Returns:
- the updated row
-
getPropertyName
The propertyName of the list backing this collection- Specified by:
getPropertyNamein interfaceDataBinding- Returns:
- the propertyName of this collection
-
setPropertyName
Set the propertyName- Parameters:
propertyName-
-
getBindingInfo
The bindingInfo for this collection table, containg the property path and other options- Specified by:
getBindingInfoin interfaceDataBinding- Returns:
- the bindingInfo
- See Also:
-
setBindingInfo
Set the bindingInfo- Specified by:
setBindingInfoin interfaceDataBinding- Parameters:
bindingInfo-
-
getHeaderLabels
The labels for the header derived from the items of this collection (the fields)- Returns:
- the header labels
-
getRichTable
The richTable widget definition for this table for setting dataTable javascript options- Returns:
- the RichTable widget
-
setRichTable
Set the richTable widget- Parameters:
richTable-
-
getConditionalRowCssClasses
The row css classes for the rows of this layoutTo 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
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
-
setExpressionConversionMap
-
getExpressionConversionMap
-
getInitialComponentIds
-
getRenderIdExpressionMap
-
setInitialComponentIds
-
setRenderIdExpressionMap
-
setEmptyTable
public void setEmptyTable(boolean emptyTable) -
getCurrentColumnValue
- Returns:
- the current column value
-
setCurrentColumnValue
Set the current column value- Parameters:
currentColumnValue-
-