Class Input

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:
InputCheckBox, InputColorBar, InputDataCollection, InputDate, InputDecoder, InputDTZ, InputHtml, InputImage, InputLanguage, InputLookup, InputMultiDecoder, InputMultiLookup, InputPassword, InputRadio, InputRegExp, InputSymbolBar, InputText, InputUpload

@Component @Configurable @ConfigurableAttribute(name="NOTNULL",label="Not Null",type="BOOLEAN",onlyExtended=true) @ConfigurableAttribute(name="FULLSIZE",label="Full Size",type="BOOLEAN") @ConfigurableAttribute(name="SIZE",label="Size",type="LONG",properties={@Property(key="less",value="9223372036854775807"),@Property(key="greater",value="-9223372036854775808")}) @FilterCriteria(value={IS_EQUAL_TO,IS_NOT_EQUAL_TO,IS_NULL,IS_NOT_NULL,IS_LIKE}, overrideParent=false) public class Input extends Control implements Arrangeable, ValueValidator
The class implements a generic textual Input field
See Also:
GCApi:
component
  • Field Details

    • SIZE_ATTRIBUTE

      public static final String SIZE_ATTRIBUTE
      See Also:
    • FULL_SIZE_ATTRIBUTE

      public static final String FULL_SIZE_ATTRIBUTE
      See Also:
    • NOT_NULL_ATTRIBUTE

      public static final String NOT_NULL_ATTRIBUTE
      See Also:
    • FILTER_CRITERION_ATTRIBUTE

      public static final String FILTER_CRITERION_ATTRIBUTE
      See Also:
    • _msg

      protected String _msg
    • _event

      protected ListAttribute _event
    • _roevent

      protected ListAttribute _roevent
    • _eventmsg

      protected ListAttribute _eventmsg
    • _eventprompt

      protected ListAttribute _eventprompt
    • promptEmpty

      protected boolean promptEmpty
    • _eventparam

      protected ListAttribute _eventparam
    • _eventtitle

      protected ListAttribute _eventtitle
    • _eventicon

      protected ListAttribute _eventicon
    • _hints

      protected ListAttribute _hints
    • _eventsnumber

      protected int _eventsnumber
    • _value

      protected String _value
    • _maxlength

      protected String _maxlength
    • _size

      protected String _size
    • configuredSize

      protected String configuredSize
    • _placeholder

      protected String _placeholder
    • _notnull

      protected boolean _notnull
    • configuredNotNull

      protected Boolean configuredNotNull
    • _key

      protected boolean _key
    • _numeric

      protected boolean _numeric
    • _hidden

      protected boolean _hidden
    • _defaultFocus

      protected boolean _defaultFocus
    • _letterCase

      protected String _letterCase
    • _fullSize

      protected boolean _fullSize
    • configuredFullSize

      protected Boolean configuredFullSize
    • _autofocus

      protected boolean _autofocus
    • _ff

      protected ForeignField _ff
    • _label2

      protected String _label2
    • _hintsCache

      protected boolean _hintsCache
    • autocomplete

      protected String autocomplete
    • _da

      protected DABase _da
    • _dao

      protected DAO _dao
    • _dao0

      protected DAO0 _dao0
    • _query

      protected String _query
    • _hinter

      protected transient overit.geocall.basic.ui.control.Input.Hinter _hinter
    • filterCriteria

      protected Set<SqlOperator> filterCriteria
    • _msgErroreCampo

      protected String _msgErroreCampo
    • _msgCampoObbligatorio

      protected String _msgCampoObbligatorio
  • Constructor Details

    • Input

      public Input()
      Creates a new instance of Input
  • Method Details

    • setPLACEHOLDER

      public void setPLACEHOLDER(String s)
      Sets the placeholder, the short hint that usually describes the expected value that appears in the field before the user enters a value
      Parameters:
      s - The string that will appear as a placeholder in the field
    • setVALUE

      public void setVALUE(String s)
      Forcibly sets a value
      Parameters:
      s - The string that represent the value of the field
    • getDefaultValue

      public Object getDefaultValue()
      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 setVALUE(String)
      Returns:
      The default value set for this component
    • setEVENT

      public void setEVENT(String s)
      Sets one or more events associated to the input field.
      By setting an event, a button will be created inside the field, clicking on which the event will be triggered. Each button will have a default icon.
      If the input field is in readonly state, also every event button of the field is readonly (not clickable).
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the name of an event associated to the field
    • setROEVENT

      public void setROEVENT(String s)
      Sets one or more events associated to the input field when the input is in readonly state.
      By setting an event, a button will be created inside the field, clicking on which the event will be triggered. Each button will have a default icon.
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the name of an event associated to the field when is in readonly state
    • setMSG

      public void setMSG(String s)
      Sets the message that appears when the user tries to submit a value that is not valid. It is used in classes that extend Input
      Parameters:
      s - The string that contains the message
    • setSIZE

      public void setSIZE(String s)
      Sets the html size attribute of the input field
      Parameters:
      s - The size attribute expressed in number of characters
    • getSize

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

      public void setMAXLENGTH(String s)
      Sets the maxlength html attribute of the input field.
      By setting this attribute, the user will not be allowed to enter a content longer than maxlength in the field
      Parameters:
      s - The maxlength attribute expressed in number of characters
    • setNOTNULL

      public void setNOTNULL(String s)
      Defines if the value of the field can be empty when submitted
      By setting true to this attribute, the user can't make a submit until the value of the field is compiled
      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
    • setIMPORTANT

      public void setIMPORTANT(String s)
      Description copied from class: Component
      Sets if the component is an important component or not.
      If a component is important it cannot be hidden via configurability and it will be validated into the seek validation phase after a submit to the server.
      Otherwise, if the component is not important, no matter what kind of component it is (not null, hidden etc), it will be possible to hide and shows up it via configurability and the seek validation phase won't validate it after a submit.
      Overrides:
      setIMPORTANT in class Component
      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
    • setKEY

      public void setKEY(String s)
      Indicates if the field is a key field.
      At each key field is assigned a particular CSS style that makes it more evident inside the form, style based on the specific theme currently used
      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
    • setNUMERIC

      public void setNUMERIC(String s)
      Indicates if the field value should be considered as a numeric from the aspect point of view (right alignment)
      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
    • setHIDDEN

      public void setHIDDEN(String s)
      Indicates if the field will not appear in the form
      Even if the field is hidden, its value - if present - will be submitted. Typically these fields should not be placed inside a grid, because they will supply a side effect but they will not be displayed
      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
    • setDEFAULTFOCUS

      @Deprecated(forRemoval=true, since="9.1") public void setDEFAULTFOCUS(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Don't use this attribute, see setAUTOFOCUS() instead
      Parameters:
      s - See setAUTOFOCUS()
    • setLABEL2

      public void setLABEL2(String s)
      Sets a second label right next the first one. If labelInLine is true the separator will be " ", if is false it will be a simple " ". Using this method the string will be translated by the Teacher
      Parameters:
      s - The string that will appear as the second label
    • setNAME

      public void setNAME(String s)
      Sets the name associated to the input field.
      Overrides:
      setNAME in class Component
      Parameters:
      s - The name of the input field
    • setLETTERCASE

      public void setLETTERCASE(String s)
      Sets the letter case of the value of the input field.
      By setting this attribute, the value will automatically be transformed into uppercase or lowercase as the user typing
      Parameters:
      s - 'u' for uppercase, 'l' for lowecase
    • setFULLSIZE

      public void setFULLSIZE(String s)
      Indicates if the field has to occupy all the available space in width
      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
    • getFullSize

      public boolean getFullSize()
      Gets the real full size value to apply.
      This method returns the value of the attribute based on if there is a user customization on the full size attribute. If there is no customization returns the default value.
      Returns:
      the real full size value to apply
    • setAUTOFOCUS

      public void setAUTOFOCUS(String s)
      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
      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
    • setPARAM

      @Deprecated(forRemoval=true, since="9.1") public void setPARAM(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setEVENTPARAM instead
      Parameters:
      s - Use setEVENTPARAM instead
    • setPROMPT

      @Deprecated(forRemoval=true, since="9.1") public void setPROMPT(String s)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use setEVENTPROMPT instead
      Parameters:
      s - Use setEVENTPROMPT instead
    • setEVENTPARAM

      public void setEVENTPARAM(String s)
      Sets one (or more) parameter for the events associated to the field (see setEVENT()).
      For the association event - parameter, it counts the position in which the attributes appear. If the parameters are fewer than the events, the last parameter of the list is associated with all the remaining events.
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the param attribute of an event associated to the field
    • setEVENTPROMPT

      public void setEVENTPROMPT(String s)
      Sets one (or more) string that appear as prompt for the events associated to the field (see setEVENT()).
      For the association event - prompt, it counts the position in which the attributes appear. If the prompts are fewer than the events, the last prompt of the list is associated with all the remaining events.
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the prompt attribute of an event associated to the field
    • setEVENTMSG

      public void setEVENTMSG(String s)
      Sets one (or more) string that appear as messages for the events associated to the field (see setEVENT()).
      For the association event - message, it counts the position in which the attributes appear. If the messages are fewer than the events, the last message of the list is associated with all the remaining events.
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the msg attribute of an event associated to the field
    • setPROMPTEMPTY

      public void setPROMPTEMPTY(String s)
      Sets if the value returned by the prompt can be an empty string ""
      Parameters:
      s - true if you want to allow to return an empty value by the prompt, false otherwise.
    • setEVENTTITLE

      public void setEVENTTITLE(String s)
      Sets one (or more) string that appear as tooltip when the user positions the cursor over the button of an event associated to the field (see setEVENT()).
      For the association event - title, it counts the position in which the attributes appear. If the titles are fewer than the events, the last title of the list is associated with all the remaining events.
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the title attribute of an event associated to the field
    • setICON

      public void setICON(String icon)
      Sets one (or more) icon that is associated to the button of an event associated to the field (see setEVENT()).
      For the association event button - icon, it counts the position in which the attributes appear. If the icons are fewer than the events, the last icon of the list is associated with all the remaining events.
      Overrides:
      setICON in class Component
      Parameters:
      icon - A ListAttribute of strings (separated by the character | ) each of which represents the path of an icon associated to a button of an event on the field
    • getNOTNULL

      public boolean getNOTNULL()
      Retrieves the value of the notnull attribute
      Returns:
      true if the field cannot be empty when submitted, false otherwise
    • isNotNull

      public boolean isNotNull()
      Gets the real not null value to apply.
      This method returns the value of the attribute based on if there is a user customization on the not null attribute. If there is no customization returns the default value.
      Returns:
      the real not null value to apply
    • getHIDDEN

      public boolean getHIDDEN()
      Retrieves the value of the hidden attribute
      Returns:
      true if the field is hidden, false otherwise
    • setHINTS

      public void setHINTS(String values)
      Sets a list of static hints for the field. By setting this list, a button will be created inside the field, clicking on which will appear a menu in which each voice corresponds to one hint, with the possibility to select one of them. Even if there are some static hints, the user can fill the field with every other value.
      Parameters:
      values - A ListAttribute of strings (separated by the character | ) each of which represents one static hint
    • setHints

      public void setHints(String[] values)
      Sets a list of static hints for the field. By setting this list, a button will be created inside the field, clicking on which will appear a menu in which each voice corresponds to one hint, with the possibility to select one of them. Even if there are some static hints, the user can fill the field with every other value.
      Parameters:
      values - A ListAttribute of array of strings each of which represents one static hint
    • setDA

      public void setDA(Object da)
      Creates (in association with setQUERY()) an input field with dynamic hints.
      Using these methods, during the user input on the field will appear a dynamic menu containing a list of voices based on the value that the user is inserting.
      Parameters:
      da - The DABase used in association with a query setQUERY()) to extract the dynamic hints
    • setDAO

      public void setDAO(Object dao)
      Creates (in association with setQUERY()) an input field with dynamic hints.
      Using these methods, during the user input on the field will appear a dynamic menu containing a list of voices based on the value that the user is inserting.
      Parameters:
      dao - The DAO used in association with a query setQUERY()) to extract the dynamic hints
    • setDAO0

      public void setDAO0(Object dao0)
      Creates (in association with setQUERY()) an input field with dynamic hints.
      Using these methods, during the user input on the field will appear a dynamic menu containing a list of voices based on the value that the user is inserting.
      Parameters:
      dao0 - The DAO0 used in association with a query setQUERY()) to extract the dynamic hints
    • setQUERY

      public void setQUERY(String query)
      Creates (in association with setDA()) an input field with dynamic hints.
      Using these methods, during the user input on the field will appear a dynamic menu containing a list of voices based on the value that the user is inserting.
      Parameters:
      query - The query used in association with a DA (setDA()) to extract the dynamic hints
    • setHINTSCACHE

      public void setHINTSCACHE(String s)
      Indicates if the dynamic hints can be retrieved from the cache, or must be always fetched from the server.
      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 true
    • setAUTOCOMPLETE

      public void setAUTOCOMPLETE(String s)
      Sets the autocomplete attribute on the input field.
      Parameters:
      s - A string that represents the autocomplete attribute of the field. Some examples are : off,nameemail,tel,sex ecc.
      The complete list of autocomplete's value can be found on this link: https://www.w3.org/Translations/WCAG21-it/#input-purposes
    • setFILTERCRITERIA

      public void setFILTERCRITERIA(String s)
      Sets the list of allowed filter criteria for the widget, separated by commas.
      Setting this attribute the developer can narrow down the list of criteria the user can apply to the field. The list of criteria must be indicated follow the SqlOperator values.
      For Example: filterCriteria="eq,ne" to allowing only those two criteria.
      Parameters:
      s - the list of allowed filter criteria for the widget, separated by commas
    • setup

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

      protected void connect()
      Overrides:
      connect in class Component
    • registerValidators

      protected void registerValidators()
    • validate

      protected void validate(org.apache.ecs.html.Input i, EntitySet es, boolean ro)
    • setupAutocomplete

      protected void setupAutocomplete(org.apache.ecs.html.Input i, boolean ro)
    • getLetterCase

      protected String getLetterCase()
    • control

      protected void control(org.apache.ecs.html.Input i, EntitySet es)
    • isValueIgnoredByCriterion

      protected boolean isValueIgnoredByCriterion()
    • prepareName

      protected String prepareName()
    • prepareValue

      protected String prepareValue()
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Returns the html of the Input element
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet
      Returns:
      The html of the Input element
    • getGenerationHandle

      public Object getGenerationHandle()
      Implements the interface Arrangeable
      Specified by:
      getGenerationHandle in interface Arrangeable
      Returns:
      null
    • getDescriptionHtml

      public org.apache.ecs.Element getDescriptionHtml(Object generationhandle, EntitySet es)
      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
      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
    • getVisibleDescriptionHtml

      protected org.apache.ecs.Element getVisibleDescriptionHtml(Object generationhandle, EntitySet es)
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      Implements the interface Arrangeable. It returns the hidden but active html part of an hidden input field.
      Specified by:
      getHiddenHtml in interface Arrangeable
      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)
      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
      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
    • getClassStyle

      protected String getClassStyle(boolean ro)
      Compute the css classes associated to the field.
      Parameters:
      ro - read-only state
      Returns:
      a string containing the very classes that will be assigned to the field.
    • addEventButtons

      protected void addEventButtons(org.apache.ecs.html.TR tr, boolean ro)
      Create an event button for every event specified in the xml definition and add it to the tr
      Parameters:
      tr - table row where add the event button
      ro - read-only state
    • addHintsButton

      protected void addHintsButton(org.apache.ecs.html.TR tr, boolean ro)
      Create a button which opens the static hints dropdown menu and add it to the tr
      Parameters:
      tr - table row where add the hints button
      ro - read-only state
    • getInsideEventButton

      protected org.apache.ecs.Element getInsideEventButton(boolean ro)
    • getInsideEventButton

      protected org.apache.ecs.Element getInsideEventButton(int eventnumber, boolean ro)
    • getHintsEventButton

      protected org.apache.ecs.Element getHintsEventButton(boolean ro)
    • 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 Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • getHintsFieldName

      protected String getHintsFieldName()
    • ajaxQuery

      public void ajaxQuery(HttpServletRequest request, HttpServletResponse response)
      Description copied from class: Component
      Method that must be extended to implements the Ajax interaction request / response logic for the Component
      Overrides:
      ajaxQuery in class Component
      Parameters:
      request - HttpServletRequest
      response - HttpServletResponse
    • addHint

      protected void addHint(List<String> hints, String value, String label, boolean strikethrough)
    • addHint

      protected void addHint(List<String> hints, String value, String label, boolean strikethrough, boolean selected, String selectedEventName, Object selectedKey)
    • queryHints

      protected DBView queryHints(String req, long sequence) throws InterruptedException
      Throws:
      InterruptedException
    • validateValue

      public void validateValue(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Description copied from interface: ValueValidator
      Makes the validation to avoid tampering values of a component and it's value.
      When a submit event to the server is triggered, is checked that the component is in the validator set, the value is not changed (if the component is RO), the value is changed with an allow value ecc ecc.
      Specified by:
      validateValue in interface ValueValidator
      Parameters:
      name - The name associated to the component to validate.
      value - The value to validate
      strong - Defines if the validation must be strong or not (for not null component).
      arriving - A Map with all the components (and their values) arriving from submit.
      Throws:
      ValidationException - Raised if the validation failed.
    • validateUnchangingValue

      protected void validateUnchangingValue(String name, Object value, Object published, boolean strong, Map arriving) throws ValidationException
      Throws:
      ValidationException
    • validateChangingValue

      protected void validateChangingValue(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Throws:
      ValidationException
    • validateNotNull

      protected void validateNotNull(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Throws:
      ValidationException
    • validateConcreteValue

      protected void validateConcreteValue(String name, Object value, boolean strong, Map arriving) throws ValidationException
      Throws:
      ValidationException
    • isImportant

      public boolean isImportant()
      Gets if this Input is important or not. An Input object is considered important if it cannot be null or if it is hidden.
      Overrides:
      isImportant in class Control
      Returns:
      true if this Input is important, false otherwise.
    • 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 Control
      Parameters:
      properties - The map containing the configured properties to set
    • 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 Control
      Parameters:
      dataAttribute - a non-null DataAttribute used to set model properties
    • getConfigurableProperties

      public Collection<overit.geocall.ux.configurability.UIProperty> getConfigurableProperties()
      Description copied from interface: overit.geocall.ux.configurability.UIConfigurable
      Gets a set of UIProperty object that represents the configurable UI properties that the object can handle.
      Each UIProperty object, can be used to retrieve some information about the configurable property, for example it can be used to design the ui xml objects to inject into the properties configurability section of the ResponsiveGrids and TableVies configurability panels.
      The property section are those section placed on the left side of the panel and shown when user click on the settings icon of a field to customize its properties.
      Specified by:
      getConfigurableProperties in interface overit.geocall.ux.configurability.UIConfigurable
      Overrides:
      getConfigurableProperties in class Control
      Returns:
      object that represents the configurable UI properties that the object can handle.
    • getFilterCriteriaToRemove

      protected Set<SqlOperator> getFilterCriteriaToRemove(Set<overit.geocall.ux.configurability.UIProperty> properties)