Class InputLookup

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
Direct Known Subclasses:
InputMultiSelectLookup

This class extends Input and implements the graphic user interface element that presents a set of values selectable through a drop-down menu that appears when the user clicks on the field.
Values can be specified statically by adding a list of InputOption as children of the component, or dynamically, loading them from the database using a StaticView. If you want to allow the selection of a null value, you can simply add an empty InputOption as the first child of the component.
If the options list size is over the searchThreshold attribute, the drop down that will be shown. will be a seacrchable drop down list, with an input field that allow the user to search among the available options and so filter all the options.
See Also:
GCApi:
component
  • Field Details

    • STRING_PARENT_TYPE

      protected static final String STRING_PARENT_TYPE
      See Also:
    • CLASS_HTML_ATTRIBUTE

      protected static final String CLASS_HTML_ATTRIBUTE
      See Also:
    • ORDER_ATTRIBUTE

      public static final String ORDER_ATTRIBUTE
      See Also:
    • _type

      protected int _type
    • _defaultValue

      protected String _defaultValue
    • _defaultOption

      protected String _defaultOption
    • _parentLookup

      protected String _parentLookup
    • _parentType

      protected String _parentType
    • _childLookup

      protected String _childLookup
    • _childType

      protected String _childType
    • _autoevent

      protected String _autoevent
    • _autoeventparam

      protected String _autoeventparam
    • _autoeventmsg

      protected String _autoeventmsg
    • _autoeventanchor

      protected String _autoeventanchor
    • _roexpanse

      protected boolean _roexpanse
    • searchThreshold

      protected int searchThreshold
    • order

      protected String order
    • configuredOrder

      protected String configuredOrder
    • containsEmptyOption

      protected boolean containsEmptyOption
    • _autohidden

      protected boolean _autohidden
    • _msgCampoValoreNonValido

      protected String _msgCampoValoreNonValido
  • Constructor Details

    • InputLookup

      public InputLookup()
      Creates an InputLookup
  • Method Details

    • setSEARCHTHRESHOLD

      public void setSEARCHTHRESHOLD(String searchThreshold)
      Sets the threshold beyond which the component will allow you to search among the options defined, using an input filter field.
      Parameters:
      searchThreshold - The bound to set.
    • getSearchThreshold

      public int getSearchThreshold()
      Gets the threshold beyond which the component will allow you to search among the options defined, using an input filter field.
      Returns:
      The defined threshold.
    • setPARENTLOOKUP

      @Deprecated(forRemoval=true, since="9.1") public void setPARENTLOOKUP(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Don't use it anymore. Sets the parent lookup, with setCHILDLOOKUP(java.lang.String) define a dependency between two InputLookup.
      Parameters:
      s - The name of the parent lookup
    • setPARENTTYPE

      @Deprecated(forRemoval=true, since="9.1") public void setPARENTTYPE(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Don't use it anymore. Defines the type of the field values for the parent lookup.
      Parameters:
      s - Accepted values are: "long" (that is also the default one), to state that the values are Long values; "string" to state that the values are String values.
    • setCHILDLOOKUP

      @Deprecated(forRemoval=true, since="9.1") public void setCHILDLOOKUP(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Don't use it anymore. Sets the child lookup, with setPARENTLOOKUP(java.lang.String) define a dependency between two InputLookup.
      Parameters:
      s - The name of the child lookup
    • setCHILDTYPE

      @Deprecated(forRemoval=true, since="9.1") public void setCHILDTYPE(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Don't use it anymore. Defines the type of the field values for the child lookup.
      Parameters:
      s - Accepted values are: "long" (that is also the default one), to state that the values are Long values; "string" to state that the values are String values.
    • setAUTOHIDDEN

      public void setAUTOHIDDEN(String s)
      Defines if the field must be hidden when it has only one child
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setAUTOFOCUS

      public void setAUTOFOCUS(String s)
      Description copied from class: Input
      Indicates if the field is the one that has the focus.
      If you want to force the focus on a specific field you must set the attribute to true, and every other field that appears before that one in the form must have this attribute set to false
      Overrides:
      setAUTOFOCUS in class Input
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setROEXPANSE

      public void setROEXPANSE(String s)
      Defines if the list of the options should be shown when the field is in the read only state, or not
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • setORDER

      public void setORDER(String s)
      Sets the order mode with which the dropdown elements will be sorted.
      Possible values are:
      • ASC: dropdown elements labels will be sorted in a Ascending way
      • DESC: dropdown elements labels will be sorted in a Descending way
      Parameters:
      s - The order mode.
    • getOrder

      public String getOrder()
      Gets the real order value to apply.
      This method returns the value of the attribute based on if there is a user customization on the order attribute. If there is no customization returns the default value.
      Returns:
      the real order value to apply
    • setup

      protected void setup()
      Description copied from class: Component
      Setup the Component
      Overrides:
      setup in class Input
    • setTYPE

      public void setTYPE(String s)
      Defines the type of the field values.
      Parameters:
      s - Accepted values are: "long" (that is also the default one), to state that the values are Long values; "string" to state that the values are String values.
    • setAUTOEVENTANCHOR

      public void setAUTOEVENTANCHOR(String s)
      Defines the name of the anchor that is used to reposition the scrolling of the page following the execution of the autoevent associated with the Input. The name must correspond to the value of a reference attribute of a Grid or a Section, set using the appropriate set methods (Grid.setREF(String), Section.setREF(String)).
      The relocation mechanism works only with non-Ajax events, the ones that reload the page.
      Parameters:
      s - The name of the anchor
    • setAUTOEVENT

      public void setAUTOEVENT(String s)
      Sets the name of an event associated to the field and triggered when the user changes its value. By setting an autoevent, a form submit will be automatically performed when the field loses the focus.
      Parameters:
      s - The name of the event triggered when the user changes the field value
    • setAUTOEVENTPARAM

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

      public void setAUTOEVENTMSG(String s)
      Sets the string that appear as messages for the event associated to the field (see setAUTOEVENT()).
      Parameters:
      s - A string that represents the msg attribute of the event associated to the field
    • setVALUE

      public void setVALUE(String s)
      Description copied from class: Input
      Forcibly sets a value
      Overrides:
      setVALUE in class Input
      Parameters:
      s - The string that represent the value of the field
    • setFULLSIZE

      public void setFULLSIZE(String s)
      Description copied from class: Input
      Indicates if the field has to occupy all the available space in width
      Overrides:
      setFULLSIZE in class Input
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
      If the string is not recognized as a boolean value, it will be used the default value, that is false
    • getNOTNULL

      public boolean getNOTNULL()
      Description copied from class: Input
      Retrieves the value of the notnull attribute
      Overrides:
      getNOTNULL in class Input
      Returns:
      true if the field cannot be empty when submitted, false otherwise
    • validate

      protected void validate(org.apache.ecs.html.Select sel, EntitySet es, boolean ro)
    • typeString

      public boolean typeString()
    • typeBoolean

      public boolean typeBoolean()
    • getHiddenHtml

      protected org.apache.ecs.Element getHiddenHtml(String htmlname, List v)
    • getDescriptionHtml

      public org.apache.ecs.Element getDescriptionHtml(Object generationhandle, EntitySet es)
      Description copied from class: Input
      Implements the interface Arrangeable. It returns the html code that represents the component description i.e. the formatted label of the field
      Specified by:
      getDescriptionHtml in interface Arrangeable
      Overrides:
      getDescriptionHtml in class Input
      Parameters:
      generationhandle - The handle of the generation
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the label, or null if the field don't have it or is hidden
    • getGenerationHandle

      public Object getGenerationHandle()
      Description copied from class: Input
      Implements the interface Arrangeable
      Specified by:
      getGenerationHandle in interface Arrangeable
      Overrides:
      getGenerationHandle in class Input
      Returns:
      null
    • prepareName

      protected String prepareName()
      Overrides:
      prepareName in class Input
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      Description copied from class: Input
      Implements the interface Arrangeable. It returns the hidden but active html part of an hidden input field.
      Specified by:
      getHiddenHtml in interface Arrangeable
      Overrides:
      getHiddenHtml in class Input
      Parameters:
      generationhandle - The handle of the generation
      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.
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      Description copied from class: Input
      Implements the interface Arrangeable. It returns the html code that represents the active part of the input field, i.e. the field and the validation scripts
      Specified by:
      getContentHtml in interface Arrangeable
      Overrides:
      getContentHtml in class Input
      Parameters:
      generationhandle - The handle of the generation
      es - The EntitySet to which the element belongs
      Returns:
      The html code of the input field or null if the field don't have a graphical representation
    • getContentHtmlLookUp

      protected org.apache.ecs.Element getContentHtmlLookUp(Object generationhandle, EntitySet es, List v)
    • getContentHtmlDropDown

      protected org.apache.ecs.Element getContentHtmlDropDown(Object generationhandle, EntitySet es, List v)
    • appendStyle4Mac

      protected void appendStyle4Mac(org.apache.ecs.html.Select select)
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Input
      Returns the html of the Input element
      Overrides:
      getHtml in class Input
      Parameters:
      es - The EntitySet
      Returns:
      The html of the Input element
    • createTag

      protected org.apache.ecs.ElementContainer createTag(List hs)
    • publishValue

      protected void publishValue(Object value)
    • isSelected

      protected boolean isSelected(Object inMemoryValue, String sCurrentValue, boolean defaultSelection)
    • buildDisplayScript

      public void buildDisplayScript(StringBuilder sb)
      Every component can add a script to the StringBuilder, script executed when the component is displayed. The method add the script that controls the focus on the input field.
      Overrides:
      buildDisplayScript in class Input
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • 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 controls the selected value of the field.
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • validateConcreteValue

      public void validateConcreteValue(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Overrides:
      validateConcreteValue in class Input
      Throws:
      ValidationException
    • 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
    • setModelProperties

      public void setModelProperties(@NotNull @NotNull DataAttribute dataAttribute)
      Description copied from interface: overit.geocall.ux.edm.ModelConfigurable
      Sets the model properties based on the provided DataAttribute.
      Specified by:
      setModelProperties in interface overit.geocall.ux.edm.ModelConfigurable
      Overrides:
      setModelProperties in class Input
      Parameters:
      dataAttribute - a non-null DataAttribute used to set model properties
    • 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
    • getFilterCriteriaToRemove

      protected Set<SqlOperator> getFilterCriteriaToRemove(Set<overit.geocall.ux.configurability.UIProperty> properties)
      Overrides:
      getFilterCriteriaToRemove in class Input