Class InputCheckBox

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

@Component @Configurable @ConfigurableAttribute(name="STATES",label="States",type="LONG",onlyExtended=true,values={@Value(value="",label="Default"),@Value(value="2",label="2"),@Value(value="3",label="3")},properties={@Property(key="type",value="long"),@Property(key="fullsize",value="true")}) @FilterCriteria({IS_EQUAL_TO,IS_NOT_EQUAL_TO,IS_NULL,IS_NOT_NULL}) public class InputCheckBox extends Input implements Arrangeable
This components implements an input checkbox, a field that the user can mark as checked (true value), unchecked (false value) or neither (null value). It is possible to state that the input must have only two states (true / false).
The aspect of the input, i.e. the icon that is used, depends on the theme currently in use in the application.
See Also:
GCApi:
component
  • Field Details

    • STATES_ATTRIBUTE

      public static final String STATES_ATTRIBUTE
      See Also:
    • checked

      protected Boolean checked
    • _inverse

      protected boolean _inverse
    • _autoevent

      protected String _autoevent
    • _autoeventparam

      protected String _autoeventparam
    • _states

      protected int _states
    • configuredStates

      protected Integer configuredStates
  • Constructor Details

    • InputCheckBox

      public InputCheckBox()
      Creates an InputCheckBox
  • Method Details

    • setVALUE

      public void setVALUE(String s)
      Sets the value of the InputCheckBox
      Overrides:
      setVALUE in class Input
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the parameter is null, or an empty string, the value of the input is set to null.
      It the string is not recognized as a boolean value, it will be used the default value, that is false
    • getDefaultValue

      public Object getDefaultValue()
      Description copied from class: Input
      Gets the default value set for this component.
      The default value of the component is the value set for the attribute value into the xml. See Input.setVALUE(String)
      Overrides:
      getDefaultValue in class Input
      Returns:
      The default value set for this component
    • setINVERSE

      public void setINVERSE(String s)
      Defines the position of the label. If false the label is positioned to the right of the field, otherwise the order is inverted (and the label will appear at the left of the field).
      If the field is inserted into an ArrangingGrid this attribute has no effect.
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      It the string is not recognized as a boolean value, it will be used the default value, that is false
    • setSTATES

      public void setSTATES(String s)
      Sets the number of possible values for the InputCheckBox
      Parameters:
      s - The number that indicates the possible values that the field can take.
      Possible values are:
      3 (default): the field's value can be true, false or null
      2: the field's value can be true or false
    • getStates

      public int getStates()
      Gets the real states value to apply.
      This method returns the value of the attribute based on if there is a user customization on the states attribute. If there is no customization returns the default value.
      Returns:
      The number that indicates the possible values that the field can take.
      Possible values are:
      3 (default): the field's value can be true, false or null
      2: the field's value can be true or false
    • setAUTOEVENT

      public void setAUTOEVENT(String s)
      Sets the event associated to the field, triggered when the user clicks on the input and change its value
      Parameters:
      s - A string that represents the name of the event associated to the field
    • setAUTOEVENTPARAM

      public void setAUTOEVENTPARAM(String s)
      Sets the parameter for the event associated to the field (see setAUTOEVENT(String))
      Parameters:
      s - The string that represents the param attribute of the event associated to the field
    • prepareValue

      public String prepareValue()
      Overrides:
      prepareValue in class Input
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      It returns the html code that represents the active part of the input checkbox field. Implements the interface Arrangeable.
      Specified by:
      getContentHtml in interface Arrangeable
      Overrides:
      getContentHtml in class Input
      Parameters:
      generationhandle - the unique generating handle
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the input field or null if the field is hidden
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Creates the InputCheckBox element
      Overrides:
      getHtml in class Input
      Parameters:
      es - The EntitySet
      Returns:
      The html of the field
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      It returns the hidden but active html part of an hidden input field. Implements the interface Arrangeable.
      Specified by:
      getHiddenHtml in interface Arrangeable
      Overrides:
      getHiddenHtml in class Input
      Parameters:
      generationhandle - the unique generating handle
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the hidden part of the field or null if the field is visible.
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Every component can add a script to the StringBuilder, script executed when the component is created. The method add the script that setups the field
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • setConfiguredProperty

      public void setConfiguredProperty(Map<String,Serializable> properties)
      Description copied from interface: overit.geocall.ux.configurability.UIConfigurable
      Apply the user's properties customization into the component.
      Specified by:
      setConfiguredProperty in interface overit.geocall.ux.configurability.UIConfigurable
      Overrides:
      setConfiguredProperty in class Input
      Parameters:
      properties - The map containing the configured properties to set