Class MultiDecoder

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

@Component public class MultiDecoder extends Output
This class implements the graphic user interface elements that is used to decode a list of inputs in the corresponding values, inputs selected by the user from a StaticView rather than from the database through a task, or a DBView. It is similar to the InputDecoder, but allows multiple selections.
From the logical point of view, this field is an Input; but since it must contain multiple values, it is not possible to edit them directly within the field, and therefore from the implementation point of view it extends Output.
This means that the form must be in additive mode (see Form.setMODE(java.lang.String)) and the values of the field will not be submitted, but must be retrieved from the form's values (see Control.getValues())
See Also:
GCApi:
component
  • Field Details

    • _decodedValues

      protected ArrayList _decodedValues
    • _panel

      protected String _panel
    • _page

      protected String _page
    • _key

      protected String _key
    • _da

      protected DABase _da
    • _staticView

      protected StaticView _staticView
    • _dbv

      protected DBView _dbv
    • _notnull

      protected boolean _notnull
    • _fullsize

      protected boolean _fullsize
    • _autoevent

      protected String _autoevent
    • _autoeventparam

      protected String _autoeventparam
    • _format

      protected MapFormat _format
    • _items

      protected int _items
    • _separator

      protected String _separator
    • _size

      protected int _size
    • _editIcon

      protected Icon _editIcon
    • _resetIcon

      protected Icon _resetIcon
    • _msgEdita

      protected String _msgEdita
    • _msgSvuota

      protected String _msgSvuota
    • _type

      protected int _type
  • Constructor Details

    • MultiDecoder

      public MultiDecoder()
      Main constructor
  • Method Details

    • setPANEL

      public void setPANEL(String p)
      Sets the registryname that identifies the Panel that will be displayed when the user clicks on the magnifier button, triggering the onSearch(java.lang.Object) event. The panel should contain a list representing the codes and theirs decoded values, and allows the user to directly select one or more of them. To return the selected value to the MultiDecoder, it is possible to invoke the setDecoding(java.util.ArrayList) method of the instance of the MultiDecoder that has opened the panel
      Parameters:
      p - The registryname that identifies the panel that lists the possible values to select
    • setKEY

      public void setKEY(String key)
      Sets the name of the model field containing the key value
      Overrides:
      setKEY in class Output
      Parameters:
      key - The name of the key field
    • setDA

      public void setDA(Object o)
      Sets the DABase that will be used to extract the records from the data layer whose codes match against the ones selected by the user. This attribute must be prefixed with the "obj_" string (like: obj_da) to allows the automatic cast to work
      Parameters:
      o - The DABase associated to the MultiDecoder
    • setNOTNULL

      public void setNOTNULL(String notnull)
      Defines if the value of the field can be empty when submitted.
      This field extends Output, so the validation must be performed programmatically, and is not provided by the kernel. This attribute must be used to maintain the same aspect for the label of the field, maintaining the interface coherence.
      Parameters:
      notnull - 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()
      Checks the value of the notnull attribute, set with the setNOTNULL(java.lang.String) method
      Returns:
      The boolean value of the attribute
    • 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
    • setAUTOEVENT

      public void setAUTOEVENT(String s)
      Sets the name of the event associated to the field and triggered when the user changes the field value.
      Parameters:
      s - The string that represents the name of the event associated to the field
    • setAUTOEVENTPARAM

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

      public void setFORMAT(String s)
      Sets the string that defines the MapFormat of the displayed values. Usually the format is defined in such a way that facilitates the readability. This attribute is mandatory.
      Parameters:
      s - The string that defines a MapFormat
    • setVALUE

      public void setVALUE(String s)
      Forcibly sets a value
      Overrides:
      setVALUE in class Output
      Parameters:
      s - The string that represent the value of the field
    • setITEMS

      public void setITEMS(String n)
      Defines the maximum number of values displayed in the field. If the selected values are more than this value, in the field will appear three suspension points, to indicate that the decoded values are more than the ones currently displayed. In these cases, when the user stops the cursor on the field, it will appear a tooltip that will show all the values
      Parameters:
      n - The maximum number of values displayed
    • setSEPARATOR

      public void setSEPARATOR(String s)
      Defines the string used as separator between the displayed values. The default value is the comma (,) character
      Parameters:
      s - The string used as separator
    • setSIZE

      public void setSIZE(String s)
      Sets the html size attribute of the field
      Overrides:
      setSIZE in class Output
      Parameters:
      s - The size attribute expressed in number of characters
    • 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.
    • setSTATICVIEW

      public void setSTATICVIEW(String path)
      Sets the reference to the StaticView that will be used to extract the records from the data layer whose codes match against the ones selected by the user. This attribute must be prefixed with the underscore character (like: _staticView) to allows the UIFactory mechanism to resolve the correct path of the XML file.
      Parameters:
      path - The reference path to the StaticView used by the MultiDecoder
    • getDa

      public DABase getDa()
      Returns the DABase associated to the field. See setDA(java.lang.Object)
      Returns:
      The DABase associated to the MultiDecoder
    • setDBView

      public void setDBView(DBView dbv)
      Sets the DBView that contains the records whose codes match against the ones selected by the user
      Parameters:
      dbv - The DBView to associate to the MultiDecoder
    • getDBView

      public DBView getDBView()
      Returns the DBView that contains the records whose codes match against the ones selected by the user
      Returns:
      The DBView associated to the MultiDecoder
    • getKey

      public String getKey()
      Returns the name of the model field containing the key value
      Returns:
      The name of the key field
    • getDecodedValues

      public ArrayList getDecodedValues()
      Returns the decoded values of the field
      Returns:
      The ArrayList containing the decoded values
    • setup

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

      public ElementList getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Overrides:
      getHtml in class Output
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • getDescriptionHtml

      public org.apache.ecs.Element getDescriptionHtml(Object generationhandle, EntitySet es)
      Description copied from interface: Arrangeable
      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 Output
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the label of the field
    • getContentHtml

      public org.apache.ecs.Element getContentHtml(Object generationhandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the html code that represents the active part of the component, i.e. the field and the validation scripts
      Specified by:
      getContentHtml in interface Arrangeable
      Overrides:
      getContentHtml in class Output
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the component
    • setEVENT

      public void setEVENT(String s)
      Description copied from class: Output
      Sets one or more events associated to the output 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.
      Overrides:
      setEVENT in class Output
      Parameters:
      s - A ListAttribute of strings (separated by the character | ) each of which represents the name of an event associated to the field
    • getEventButton

      protected org.apache.ecs.Element getEventButton(boolean ro)
    • getCleanButton

      protected org.apache.ecs.Element getCleanButton(boolean ro)
    • onSearch

      public boolean onSearch(Object o)
      Called when the user clicks on the magnifier icon, it shows a Panel (setPANEL(java.lang.String). The page or panel should contain a list representing the codes and theirs decoded values, and should allows the user to directly select a set of them.
      Parameters:
      o - Not used
      Returns:
      false
    • onClean

      public boolean onClean(Object o)
      Called when the user clicks on the x icon in the field, it clears the value of the field. At the end it calls the autoevent, if set (setAUTOEVENT(java.lang.String))
      Parameters:
      o - Not used
      Returns:
      false
    • changeCollectedValue

      protected void changeCollectedValue(String name, Object value)
    • compareDecodedValues

      protected boolean compareDecodedValues(ArrayList a1, ArrayList a2)
    • removeMetaData

      protected HashGetter removeMetaData(HashGetter hg)
    • setDecoding

      public void setDecoding(ArrayList al)
      Sets the decoded values of the MultiDecoder, starting from the content of the ArrayList passed as parameter, that must contain the entry keys
      Parameters:
      al - The ArrayList that contains the decoded values
    • setValue

      protected void setValue(Set value)
    • getTooltip

      protected String getTooltip()
    • getTooltip

      protected String getTooltip(boolean maxLengthExceeded)