org.kuali.rice.krad.uif.util
Class ColumnCalculationInfo

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.util.ColumnCalculationInfo
All Implemented Interfaces:
Serializable, DictionaryBean, UifDictionaryBean

public class ColumnCalculationInfo
extends UifDictionaryBeanBase
implements Serializable

ColumnCalculationInfo is used to specify which columns and what types of calculations are performed on those columns of table collection. This functionality can only be used when the dataTables plugin is being used (richTable.render="true" for TableLayoutManager)

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

Constructor Summary
ColumnCalculationInfo()
           
 
Method Summary
protected
<T> void
copyProperties(T columnCalculationInfo)
          Copies properties for copy()
 String getCalculationFunctionExtraData()
          This specifies extra data to be sent to the calculation function.
 String getCalculationFunctionName()
          Gets the js calculationFunctionName.
 Integer getColumnNumber()
          Gets the column number.
 MessageField getGroupTotalFieldPrototype()
          Gets the groupTotalFieldPrototype.
 MessageField getPageTotalField()
          Gets the pageTotalField.
 String getPropertyName()
          Get the propertyName of the field to do calculations.
 MessageField getTotalField()
          Gets the totalField.
 boolean isCalculateOnKeyUp()
          If true, the column is calculated when the user enters a character on each key up.
 boolean isRecalculateTotalClientSide()
          When set to false, calculations will not be fired for the totalField client-side.
 boolean isShowGroupTotal()
          Gets showGroupTotal.
 boolean isShowPageTotal()
          Gets showTotal.
 boolean isShowTotal()
          Gets showTotal.
 void setCalculateOnKeyUp(boolean calculateOnKeyUp)
          Sets calculateOnKeyUp which controls the type of handler used
 void setCalculationFunctionExtraData(String calculationFunctionExtraData)
          Sets the calculationFunctionExtraData which specifies additional data to pass into the calculationFunction.
 void setCalculationFunctionName(String calculationFunctionName)
          Sets the calculationFunctionName to call when doing column calculations
 void setColumnNumber(Integer columnNumber)
          Sets the column number.
 void setGroupTotalFieldPrototype(MessageField groupTotalFieldPrototype)
          Sets the groupTotalFieldPrototype.
 void setPageTotalField(MessageField pageTotalField)
          Sets the pageTotalField.
 void setPropertyName(String propertyName)
          Set the propertyName of the field to do calculations on
 void setRecalculateTotalClientSide(boolean recalculateTotalClientSide)
          Set the recalculateTotalClientSide flag
 void setShowGroupTotal(boolean showGroupTotal)
          Sets showGroupTotal.
 void setShowPageTotal(boolean showPageTotal)
          Sets showPageTotal.
 void setShowTotal(boolean showTotal)
          Sets showTotal.
 void setTotalField(MessageField totalField)
          Sets the totalField.
 
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
copy, 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.datadictionary.DictionaryBean
getComponentCode, getNamespaceCode
 

Constructor Detail

ColumnCalculationInfo

public ColumnCalculationInfo()
Method Detail

getColumnNumber

public Integer getColumnNumber()
Gets the column number. This should not be set through configuration as it is overridden by the propertyName's caclculated column number. Do not set through xml configuration

Returns:
columnNumber to perform calculations on

setColumnNumber

public void setColumnNumber(Integer columnNumber)
Sets the column number. Do not set through xml configuration

Parameters:
columnNumber -

isShowTotal

public boolean isShowTotal()
Gets showTotal. showTotal shows/calculates the total field when true, otherwise it is not rendered.

Returns:
true if showing the total, false otherwise.

setShowTotal

public void setShowTotal(boolean showTotal)
Sets showTotal. showTotal shows/calculates the total field when true, otherwise it is not rendered.

Parameters:
showTotal -

isShowPageTotal

public boolean isShowPageTotal()
Gets showTotal. showTotal shows/calculates the total field when true, otherwise it is not rendered.

Returns:
true if showing the page total, false otherwise.

setShowPageTotal

public void setShowPageTotal(boolean showPageTotal)
Sets showPageTotal. showPageTotal shows/calculates the total field for the page when true (and only when the table actually has pages), otherwise it is not rendered.

Parameters:
showPageTotal -

isShowGroupTotal

public boolean isShowGroupTotal()
Gets showGroupTotal. showGroupTotal shows/calculates the total field for each grouping when true (and only when the table actually has grouping turned on), otherwise it is not rendered.

Returns:
true if showing the group total, false otherwise.

setShowGroupTotal

public void setShowGroupTotal(boolean showGroupTotal)
Sets showGroupTotal. showGroupTotal shows/calculates the total field for each grouping when true (and only when the table actually has grouping turned on), otherwise it is not rendered.

Parameters:
showGroupTotal -

getCalculationFunctionName

public String getCalculationFunctionName()
Gets the js calculationFunctionName. This is the name of the js function to use in column calculations.

This must be ONLY the function by name (no parenthesis or params)
The actual js function declaration MUST take in an array of values as its first parameter. The values passed in will be all the relavant values for the calculation. Optionally, the function can also take a second parameter which can be specified by calculationFunctionExtraData. This parameter can take any valid javascript value (integer, string, JSON object, etc). In either case, the values parameter MUST be the first parameter.

Returns:
calculatinoFunctionName to call for column calculations in js

setCalculationFunctionName

public void setCalculationFunctionName(String calculationFunctionName)
Sets the calculationFunctionName to call when doing column calculations

Parameters:
calculationFunctionName -

getTotalField

public MessageField getTotalField()
Gets the totalField. This field is the field which holds the total for the column and specifies its label. This SHOULD NOT BE SET except by the base bean (in MOST cases).

Returns:
the totalField

setTotalField

public void setTotalField(MessageField totalField)
Sets the totalField. This SHOULD NOT BE SET except by the base bean (in MOST cases). Setting this property without the appropriate settings WILL break functionality.

Parameters:
totalField -

getPageTotalField

public MessageField getPageTotalField()
Gets the pageTotalField. This field is the field which holds the pageTotal for the column and specifies its label. This SHOULD NOT BE SET except by the base bean (in MOST cases).

Returns:
the pageTotalField

setPageTotalField

public void setPageTotalField(MessageField pageTotalField)
Sets the pageTotalField. This SHOULD NOT BE SET except by the base bean (in MOST cases). Setting this property without the appropriate settings WILL break functionality.

Parameters:
pageTotalField -

getGroupTotalFieldPrototype

public MessageField getGroupTotalFieldPrototype()
Gets the groupTotalFieldPrototype. This field is copied and holds the groupTotal for the column and specifies its label. This SHOULD NOT BE SET except by the base bean (in MOST cases).

Returns:
the groupTotalFieldPrototype

setGroupTotalFieldPrototype

public void setGroupTotalFieldPrototype(MessageField groupTotalFieldPrototype)
Sets the groupTotalFieldPrototype. This SHOULD NOT BE SET except by the base bean (in MOST cases). Setting this property without the appropriate settings WILL break functionality.

Parameters:
groupTotalFieldPrototype -

isCalculateOnKeyUp

public boolean isCalculateOnKeyUp()
If true, the column is calculated when the user enters a character on each key up. There is a small delay built in to prevent calculations from being fired for each key stroke.

Returns:
true if calculated the column on key up, false if calculating on change (default)

setCalculateOnKeyUp

public void setCalculateOnKeyUp(boolean calculateOnKeyUp)
Sets calculateOnKeyUp which controls the type of handler used

Parameters:
calculateOnKeyUp -

isRecalculateTotalClientSide

public boolean isRecalculateTotalClientSide()
When set to false, calculations will not be fired for the totalField client-side. This ONLY effects the totalField. If page and group totals are still shown, they will (and can only) be calculated client-side.

To use this particular feature: set this to false, and use springEL in the totalField's message.messageText to get a pre-calculated total from a field on the form. This will be refreshed when the table is refreshed, but will not be updated by client-side interactions - used for complex or special calculation mechanisms that may require server only information.

Returns:
true if calculating the totalField client-side, false otherwise

setRecalculateTotalClientSide

public void setRecalculateTotalClientSide(boolean recalculateTotalClientSide)
Set the recalculateTotalClientSide flag

Parameters:
recalculateTotalClientSide -

getCalculationFunctionExtraData

public String getCalculationFunctionExtraData()
This specifies extra data to be sent to the calculation function. This can be any valid javascript value (number, string, JSON - for passing multiple settings, etc).
The function specified by calculationFunctionName MUST take a second parameter when using this option.

Returns:
the extra data to pass into the function specified by name in calculationFunctionName

setCalculationFunctionExtraData

public void setCalculationFunctionExtraData(String calculationFunctionExtraData)
Sets the calculationFunctionExtraData which specifies additional data to pass into the calculationFunction.

Parameters:
calculationFunctionExtraData -

getPropertyName

public String getPropertyName()
Get the propertyName of the field to do calculations. This field MUST exist as one of the fields of the collection. This property must be set or an exception will be thrown.

Returns:
propertyName of the field(the column) to do calculations on

setPropertyName

public void setPropertyName(String propertyName)
Set the propertyName of the field to do calculations on

Parameters:
propertyName -

copyProperties

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

Overrides:
copyProperties in class UifDictionaryBeanBase
Parameters:
columnCalculationInfo - base bean
See Also:
DictionaryBeanBase.copy()


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