Class ColumnCalculationInfo

All Implemented Interfaces:
Serializable, Cloneable, Copyable, 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:
  • Constructor Details

    • ColumnCalculationInfo

      public ColumnCalculationInfo()
  • Method Details

    • 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 -