Class ColumnButtonCompare

All Implemented Interfaces:
Serializable, overit.geocall.marks.MethodExposer, overit.geocall.marks.NameExposer, Badgeable, Hideable, Identified, Tool, overit.geocall.ux.configurability.UIConfigurable, overit.geocall.ux.edm.ModelConfigurable

@Component public class ColumnButtonCompare extends ColumnButton
This class extends ColumnButton and implements a column that can be hidden or set readonly based on certain conditions. In particular it is possible to define a comparison rule between the value of the cell and a set of predefined values; if the rule is met, then the action is applied.
For example if you want to disable the button placed in the cell STATE if the value of the cell is greater than 0, just write the following:
<ColumnButtonCompare comparecol="STATE" operator="+" compareto="0" action="RO" />
See Also:
GCApi:
component
  • Field Details

    • _oneLineRo

      protected Boolean _oneLineRo
    • _scomparecol

      protected String _scomparecol
    • _sformatdate

      protected String _sformatdate
    • _soperator

      protected String _soperator
    • _compareto

      protected String _compareto
    • _action

      protected int _action
    • _type_operator

      protected int _type_operator
    • _type_col

      protected int _type_col
    • _sdf

      protected SimpleDateFormat _sdf
  • Constructor Details

    • ColumnButtonCompare

      public ColumnButtonCompare()
  • Method Details

    • setCOMPARETO

      public void setCOMPARETO(String compareto)
      Sets the string that contains the values that will be compared against the field's value referenced by the column set with the setCOMPARECOL(java.lang.String) method. The type of values must match with the one of the referenced field; for example, if the fielf is a Long type, the values must be a set of integers, or if it is a Date type, the value must be a string representing a date whose match the format indicated with the setDATEFORMAT(java.lang.String) method.
      Parameters:
      compareto - The string that contains the values. The types must be Long, String, Date or Boolean
    • setCOMPARECOL

      public void setCOMPARECOL(String comparecol)
      Sets the name of the field whose value will be compared with
      Parameters:
      comparecol - The name of a column
    • setACTION

      public void setACTION(String action)
      Sets the action that will be performed in case of successfully comparison.
      Parameters:
      action - Possible values are: RO to make the button read only; HIDE to make the button not visible
    • setDATEFORMAT

      public void setDATEFORMAT(String formatdate)
      Sets the format used to parse the compareTo value (setCOMPARETO(java.lang.String)) into a Date object
      Parameters:
      formatdate - The string used to define the SimpleDateFormat used to parse the Date values
    • setOPERATOR

      public void setOPERATOR(String operator)
      Sets the comparison operator
      Parameters:
      operator - Possible values are:
      = : equal operation
      - : less than operation
      + : greater than operation
      -= : less or equals than operation
      += : greater or equals than operation
      ! : not operation
      IN : operation used to test the inclusion within a set of value. In this case it is possible to set a comma separated string, into the compareTo attribute setCOMPARETO(java.lang.String) to specify more than one value.
    • getHtmlRow

      public org.apache.ecs.Element getHtmlRow(EntitySet es, int row, int pagerow, ArrayList al)
      Description copied from class: Column
      Returns the html element that defines the row
      Overrides:
      getHtmlRow in class ColumnButton
      Parameters:
      es - The EntitySet to which the element belongs
      row - The number of the row
      pagerow - The number ofd the page
      al - The list of values of the row
      Returns:
      The html element that defines the row
    • getRO

      public boolean getRO()
      Description copied from class: Control
      Returns the read only state of the Control
      Overrides:
      getRO in class Control
      Returns:
      true if the control is read only, false otherwise