Package overit.geocall.basic.ui.control
Class MultiDecoder
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.Output
overit.geocall.basic.ui.control.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
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
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
This means that the form must be in additive mode (see
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
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected DABaseprotected DBViewprotected ArrayListprotected Iconprotected MapFormatprotected booleanprotected intprotected Stringprotected Stringprotected Stringprotected booleanprotected Stringprotected Stringprotected Iconprotected Stringprotected intprotected StaticViewprotected intFields inherited from class overit.geocall.basic.ui.control.Output
_event, _eventicon, _eventsnumber, _eventtitle, _ff, _label2, _minlength, _msg, _nowrap, _numeric, _param, _prompt, _strong, _value, promptEmpty, truncate, valueWrapFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangeCollectedValue(String name, Object value) protected booleancompareDecodedValues(ArrayList a1, ArrayList a2) protected org.apache.ecs.ElementgetCleanButton(boolean ro) org.apache.ecs.ElementgetContentHtml(Object generationhandle, EntitySet es) Returns the html code that represents the active part of the component, i.e. the field and the validation scriptsgetDa()Returns theDABaseassociated to the field.Returns theDBViewthat contains the records whose codes match against the ones selected by the userReturns the decoded values of the fieldorg.apache.ecs.ElementgetDescriptionHtml(Object generationhandle, EntitySet es) Returns the html code that represents the component description i.e. the formatted label of the fieldprotected org.apache.ecs.ElementgetEventButton(boolean ro) Abstract method that must be extended and returns the html code of the ComponentgetKey()Returns the name of the model field containing thekeyvaluebooleanChecks the value of thenotnullattribute, set with thesetNOTNULL(java.lang.String)methodprotected Stringprotected StringgetTooltip(boolean maxLengthExceeded) booleanCalled when the user clicks on the x icon in the field, it clears the value of the field.booleanCalled when the user clicks on the magnifier icon, it shows aPanel(setPANEL(java.lang.String).protected HashGettervoidSets the name of the event associated to the field and triggered when the user changes the field value.voidSets the parameter for the auto event associated to the field (seesetAUTOEVENT()).voidSets theDABasethat will be used to extract the records from the data layer whose codes match against the ones selected by the user.voidSets theDBViewthat contains the records whose codes match against the ones selected by the uservoidsetDecoding(ArrayList al) Sets the decoded values of the MultiDecoder, starting from the content of theArrayListpassed as parameter, that must contain the entrykeysvoidSets one or more events associated to the output field.voidSets the string that defines theMapFormatof the displayed values.voidIndicates if the field has to occupy all the available space in widthvoidDefines the maximum number of values displayed in the field.voidSets the name of the model field containing thekeyvaluevoidsetNOTNULL(String notnull) Defines if the value of the field can be empty when submitted.
This field extendsOutput, so the validation must be performed programmatically, and is not provided by the kernel.voidSets theregistrynamethat identifies thePanelthat will be displayed when the user clicks on the magnifier button, triggering theonSearch(java.lang.Object)event.voidDefines the string used as separator between the displayed values.voidSets the html size attribute of the fieldvoidsetSTATICVIEW(String path) Sets the reference to theStaticViewthat will be used to extract the records from the data layer whose codes match against the ones selected by the user.voidDefines the type of the field valuesprotected voidsetup()Setup the Componentprotected voidvoidForcibly sets a valueMethods inherited from class overit.geocall.basic.ui.control.Output
getGenerationHandle, getHiddenHtml, getHtmlValue, prepareValue, setEVENTMSG, setEVENTPARAM, setEVENTPROMPT, setEVENTTITLE, setICON, setLABEL2, setMINLENGTH, setNAME, setNOWRAP, setNUMERIC, setPROMPTEMPTY, setSTRONG, setStyle, setTRUNCATE, setVALUEWRAPMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getBLANK, getCleaner, getConfigurableProperties, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getRO, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setConfiguredProperty, setDBLINK, setENABLED, setFUNCTION, setModelProperties, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, buildDisplayScript, buildSetupScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, connect, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBASIC, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIcon
-
Field Details
-
_decodedValues
-
_panel
-
_page
-
_key
-
_da
-
_staticView
-
_dbv
-
_notnull
protected boolean _notnull -
_fullsize
protected boolean _fullsize -
_autoevent
-
_autoeventparam
-
_format
-
_items
protected int _items -
_separator
-
_size
protected int _size -
_editIcon
-
_resetIcon
-
_msgEdita
-
_msgSvuota
-
_type
protected int _type
-
-
Constructor Details
-
MultiDecoder
public MultiDecoder()Main constructor
-
-
Method Details
-
setPANEL
Sets theregistrynamethat identifies thePanelthat will be displayed when the user clicks on the magnifier button, triggering theonSearch(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 thesetDecoding(java.util.ArrayList)method of the instance of the MultiDecoder that has opened the panel- Parameters:
p- Theregistrynamethat identifies the panel that lists the possible values to select
-
setKEY
Sets the name of the model field containing thekeyvalue -
setDA
Sets theDABasethat 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- TheDABaseassociated to the MultiDecoder
-
setNOTNULL
Defines if the value of the field can be empty when submitted.
This field extendsOutput, 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 isfalse
-
getNotNull
public boolean getNotNull()Checks the value of thenotnullattribute, set with thesetNOTNULL(java.lang.String)method- Returns:
- The boolean value of the attribute
-
setFULLSIZE
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 isfalse
-
setAUTOEVENT
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
Sets the parameter for the auto event associated to the field (seesetAUTOEVENT()).- Parameters:
s- A string that represents the param attribute of the auto event associated to the field
-
setFORMAT
Sets the string that defines theMapFormatof 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 aMapFormat
-
setVALUE
Forcibly sets a value -
setITEMS
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
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
Sets the html size attribute of the field -
setTYPE
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
Sets the reference to theStaticViewthat 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 theUIFactorymechanism to resolve the correct path of the XML file.- Parameters:
path- The reference path to the StaticView used by the MultiDecoder
-
getDa
Returns theDABaseassociated to the field. SeesetDA(java.lang.Object)- Returns:
- The
DABaseassociated to the MultiDecoder
-
setDBView
Sets theDBViewthat contains the records whose codes match against the ones selected by the user- Parameters:
dbv- TheDBViewto associate to the MultiDecoder
-
getDBView
Returns theDBViewthat contains the records whose codes match against the ones selected by the user- Returns:
- The
DBViewassociated to the MultiDecoder
-
getKey
Returns the name of the model field containing thekeyvalue- Returns:
- The name of the
keyfield
-
getDecodedValues
Returns the decoded values of the field- Returns:
- The ArrayList containing the decoded values
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
getHtml
Description copied from class:ComponentAbstract method that must be extended and returns the html code of the Component -
getDescriptionHtml
Description copied from interface:ArrangeableReturns the html code that represents the component description i.e. the formatted label of the field- Specified by:
getDescriptionHtmlin interfaceArrangeable- Overrides:
getDescriptionHtmlin classOutput- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the label of the field
-
getContentHtml
Description copied from interface:ArrangeableReturns the html code that represents the active part of the component, i.e. the field and the validation scripts- Specified by:
getContentHtmlin interfaceArrangeable- Overrides:
getContentHtmlin classOutput- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the component
-
setEVENT
Description copied from class:OutputSets 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:
setEVENTin classOutput- Parameters:
s- AListAttributeof 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
Called when the user clicks on the magnifier icon, it shows aPanel(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
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
-
compareDecodedValues
-
removeMetaData
-
setDecoding
Sets the decoded values of the MultiDecoder, starting from the content of theArrayListpassed as parameter, that must contain the entrykeys- Parameters:
al- The ArrayList that contains the decoded values
-
setValue
-
getTooltip
-
getTooltip
-