Class InputOption

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

@Component public class InputOption extends Control
This class implements a control that must be used within others and allows to indicate an option item. The components that can contain options are: InputRadio, InputLookup, OutputLookup, ColumnLookup2.
It is possible to evaluate the InputOption directly through the value attribute, or using the StaticView attribute; in this case, many options will appear as many as the values loaded in the StaticView
See Also:
GCApi:
component
  • Field Details

    • _value

      protected String _value
    • _columntitle

      protected String _columntitle
    • _titleFormat

      protected MapFormat _titleFormat
    • _labelFormat

      protected MapFormat _labelFormat
    • _columnLabel

      protected String[] _columnLabel
    • _columnkey

      protected String _columnkey
    • _columnfk

      protected String _columnfk
    • _nLabel

      protected int _nLabel
    • _tf

      protected TextFormat _tf
    • _svw

      protected StaticView _svw
    • _dbviewName

      protected String _dbviewName
    • _workingDbv

      protected transient DBView _workingDbv
    • _dbv

      protected DBView _dbv
    • _selected

      protected String _selected
    • _maxlength

      protected int _maxlength
    • _minlength

      protected int _minlength
    • _visiblePos

      protected int _visiblePos
    • _valuePos

      protected int _valuePos
    • _ffTitle

      protected ForeignField _ffTitle
    • _ffLabels

      protected ForeignField[] _ffLabels
    • _fkPos

      protected int _fkPos
    • _roName

      protected ForeignField _roName
    • visible

      protected boolean visible
  • Constructor Details

    • InputOption

      public InputOption()
  • Method Details

    • setVALUE

      public void setVALUE(String s)
      Sets forcibly a value for the option
      Parameters:
      s - The value of the option
    • setMAXLENGTH

      public void setMAXLENGTH(String s)
      Sets the maximum displayed length of the label that describes the option. If the label is longer, it is truncated to the maximum length; the entire value will be displayed as a tooltip when the user stands over the option for a while.
      Parameters:
      s - The maximum displayed length for the option, expressed in number of characters
    • setMINLENGTH

      public void setMINLENGTH(String s)
      Sets the minimum length of the label. If the label is shorter, it will be filled with spaces, up to the minimum length
      Parameters:
      s - The minimum length for the option
    • setSELECTED

      public void setSELECTED(String s)
      Defines whether the current option should be selected or not. In case there are more options selected, the last one in order of definition prevails and will be the one selected.
      Parameters:
      s - A string that represents a boolean value if the option is a child of an InputRadio), or the value of the key field if the option is a child of InputLookup
    • setLABELFORMAT

      public void setLABELFORMAT(String s)
      Sets the MapFormat with which the label will be created
      Parameters:
      s - The format for the label
    • setTITLEFORMAT

      public void setTITLEFORMAT(String s)
      Sets the MapFormat with which the title will be created
      Parameters:
      s - The format for the title
    • setFORMAT

      public void setFORMAT(String s)
      Sets the TextFormat with which the option will be created
      Parameters:
      s - The format for the option
    • setSTATICVIEW

      public void setSTATICVIEW(String path)
      Sets the reference to the StaticView that will be used to extract the records from the data layer and populate the options. This attribute must be prefixed by the underscore (like: _staticView) character to allows the UIFactory mechanism to resolve the correct path of the xml file.
      Parameters:
      path - The path of the StaticView
    • setSESSIONDBVIEW

      public void setSESSIONDBVIEW(String s)
      Sets the name of a global session DBView that will be used to populate the options
      Parameters:
      s - The name of a global session DBView
    • setCOLUMNKEY

      public void setCOLUMNKEY(String s)
      Sets the name of the field of the DBView from which the option values will be extracted
      Parameters:
      s - The name of a field of the DBView
    • setCOLUMNFK

      public void setCOLUMNFK(String s)
      Sets the name of the column used as foreign key field (used in the InputLookup object only with the multi lookup mechanism)
      Parameters:
      s - The name of the column used as foreign key field
    • setCOLUMNTITLE

      public void setCOLUMNTITLE(String s)
      Sets the string containing the name of the field whose value will be displayed as a tooltip when the user stands over the option for a while
      Parameters:
      s - The name of a field
    • setCOLUMNLABEL

      public void setCOLUMNLABEL(String s)
      Sets the string containing the name of the field from which the label will be taken.
      Parameters:
      s - The name of a field. In the case of composed labels, it is possible to indicate the name of several fields separating them with a comma
    • setDBView

      public void setDBView(DBView dbv)
      Sets the DBView used to populate the options
      Parameters:
      dbv - The DBView associated to the options
    • getDBView

      public DBView getDBView()
      Returns the DBView associated to the option
      Returns:
      The DBView
    • getVALUE

      public String getVALUE()
      Returns the value associated to the option
      Returns:
      The value of the option
    • setRONAME

      public void setRONAME(String s)
      Set the name of the field of the DBView from which the option's readonly state will be extracted
      Parameters:
      s - The name of a field of the DBView
    • setVISIBLE

      public void setVISIBLE(String s)
      Sets the visibility of the option.
      This option works only with options which DBView is not set, loaded from a StaticView or manually.
      Parameters:
      s - true if the option will be visible, false otherwise
    • setupMetadata

      public void setupMetadata()
      Called to init all the field
    • getMatchingOption

      public InputOption.MatchingOption getMatchingOption(Object value)
      Retrieves the InputOption.MatchingOption that matches with the value passed as parameter
      Parameters:
      value - The object that represents the value used for searching a matching option
      Returns:
      The InputOption.MatchingOption that matches with the value or null if there isn't one
    • getDBVMatchingOption

      protected InputOption.MatchingOption getDBVMatchingOption(Object search)
    • getStaticMatchingOption

      protected InputOption.MatchingOption getStaticMatchingOption(Object search)
    • matchingOption

      protected InputOption.MatchingOption matchingOption(List list)
    • getArrayOption

      public ArrayList getArrayOption()
      Returns the ArrayList that contains the value and some informations about the option.
      The arrays is composed by these elements:
      Position 0: value; 1: "true" or "false", defines if the value is selected or not (statically); 2: the padded label; 3: TRUE if visible, FALSE otherwise 4: title 5: foreignkey 6: label used for the title is longer than maxlength 7-*: the fields for the label
      Returns:
      The arraylist that contains the value and some informations about the option
    • validOption

      public boolean validOption(Object o)
      Checks if there is a specific option in the InputOption
      Parameters:
      o - The value of the option to search
      Returns:
      true if there is the value in the InputOption (or is read only), false otherwise
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • collectChildOptions

      public static ArrayList collectChildOptions(Component c)
      Returns the ArrayList that contains the child options for the Component passed as parameter
      Parameters:
      c - The component
      Returns:
      The list of the chils of the component
    • validOptions

      public static boolean validOptions(Component c, Object o)
      Checks if there is a specific option in the InputOption father
      Parameters:
      c - Component with all the InputOption
      o - The value of the option to search
      Returns:
      true if there is the value in the Component, false otherwise