Package overit.geocall.basic.ui.control
Class InputDecoder
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.Input
overit.geocall.basic.ui.control.InputDecoder
- 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:
AjaxInputDecoder,InputDecoderDataCollectionType,InputDecoderForecastHeader,overit.geocallapp.wfm.technicalobject.decoder.InputDecoderTechnicalObject,overit.geocallapp.wfm.amministrazione.anautente.decodifica.InputDecoderUtenti,SearchField
@Component
@Configurable
@FilterCriteria({IS_EQUAL_TO,IS_NOT_EQUAL_TO,IS_GREATER_THAN,IS_GREATER_THAN_OR_EQUAL_TO,IS_LESS_THAN,IS_LESS_THAN_OR_EQUAL_TO,IS_NULL,IS_NOT_NULL,IS_LIKE})
public class InputDecoder
extends Input
implements Arrangeable
This class implements the graphic user interface elements that is used to decode an input in the corresponding value, input selected by the user
from a
StaticView rather than from the database through a task. This component can be useful for example when there is
a model containing the user's typology and we want to decode the typology code into the relative description, or in all
situations comparable to this- 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 booleanprotected Stringprotected Stringprotected charprotected HashGetterprotected MapFormatprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected Stringprotected Stringprotected Iconprotected Iconprotected StaticViewprotected charFields inherited from class overit.geocall.basic.ui.control.Input
_autofocus, _da, _dao, _dao0, _defaultFocus, _event, _eventicon, _eventmsg, _eventparam, _eventprompt, _eventsnumber, _eventtitle, _ff, _fullSize, _hidden, _hinter, _hints, _hintsCache, _label2, _letterCase, _maxlength, _msg, _msgCampoObbligatorio, _msgErroreCampo, _notnull, _numeric, _placeholder, _query, _roevent, _size, _value, autocomplete, configuredFullSize, configuredNotNull, configuredSize, FILTER_CRITERION_ATTRIBUTE, filterCriteria, FULL_SIZE_ATTRIBUTE, NOT_NULL_ATTRIBUTE, promptEmpty, SIZE_ATTRIBUTEFields 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 TypeMethodDescriptionvoidEvery component can add a script to the StringBuilder, script executed when the component is displayed.protected voidchangeCollectedValue(String name, Object value) protected org.apache.ecs.ElementgetCleanButton(boolean ro) org.apache.ecs.ElementgetContentHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.getDa()Returns theDABaseassociated to the InputDecodergetDao()Returns theDAOassociated to the InputDecoderReturns the specific query id used for the decoding.intReturns the specific query id used for the decoding.org.apache.ecs.ElementgetDescriptionHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.protected org.apache.ecs.ElementgetEventButton(boolean ro) protected Set<SqlOperator> getFilterCriteriaToRemove(Set<overit.geocall.ux.configurability.UIProperty> properties) Implements the interfaceArrangeableorg.apache.ecs.ElementgetHiddenHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.org.apache.ecs.ElementReturns the html of the Input elementprotected org.apache.ecs.Elementprotected final booleanprotected voidmanageNoDecodedValue(org.apache.ecs.ConcreteElement ce) protected static booleannullEquals(Object o1, Object o2) booleanCalled when the user clicks on the x icon in the field, it clears the value of the field.booleanCalled to decode the value (when the user inputs the value and the field loses the focus, or when the user inputs the value and presses the tab key).voidCalled when the InputDecoder is managed with the selection of the values on a new page (setPAGE(String)), and the user returns on the page that contains the field, after the choice of the value.booleanCalled when the user clicks on the magnifier icon, it opens a page (setPAGE(String)) or shows aPanel(setPANEL(String).protected Longprotected Stringprotected StringvoidSets the name of the event associated to the field and triggered when the user change the field value.voidDefines whether the autoevent should be triggered or not when the decoded values have been programmatically set.voidSets the parameter for the auto event associated to the field (seesetAUTOEVENT()).protected voidvoidSets the name of the model field containing thecodevaluevoidSets the type of thecodevaluevoidSets the decoded values of the InputDecoder, starting from the content of theHashGetterpassed as parameter, that must contain an entrykeyand an entrycode.voidSets one or more events associated to the input field.voidSets the string that defines theMapFormatof the label that will be displayed in the not editable part of the field (on the right).voidIndicates if the field has to occupy all the available space in widthvoidSets the name of the model field containing thekeyvaluevoidsetKEYTYPE(String s) Sets the type of the key that the InputDecoder manages.voidsetNOTNULL(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 compiledvoidDefines whether to wrap or not the field valuevoidSets the path of the page that will be displayed when the user clicks on the magnifier button, triggering theonSearch(Object)event.voidSets theregistrynamethat identifies thePanelthat will be displayed when the user clicks on the magnifier button, triggering theonSearch(Object)event.voidSets the placeholder, the short hint that usually describes the expected value that appears in the field before the user enters a valuevoidsetSTATICVIEW(String path) Sets the reference to theStaticViewthat will be used to extract the record from the data layer whose code match against the one selected by the user.protected voidsetup()Setup the Componentprotected voidMethods inherited from class overit.geocall.basic.ui.control.Input
addEventButtons, addHint, addHint, addHintsButton, ajaxQuery, connect, control, getClassStyle, getConfigurableProperties, getDefaultValue, getFullSize, getHIDDEN, getHintsEventButton, getHintsFieldName, getInsideEventButton, getInsideEventButton, getLetterCase, getNOTNULL, getSize, getVisibleDescriptionHtml, isImportant, isNotNull, isValueIgnoredByCriterion, prepareValue, queryHints, registerValidators, setAUTOCOMPLETE, setAUTOFOCUS, setConfiguredProperty, setDA, setDAO, setDAO0, setDEFAULTFOCUS, setEVENTMSG, setEVENTPARAM, setEVENTPROMPT, setEVENTTITLE, setFILTERCRITERIA, setHIDDEN, setHints, setHINTS, setHINTSCACHE, setICON, setIMPORTANT, setLABEL2, setLETTERCASE, setMAXLENGTH, setModelProperties, setMSG, setNAME, setNUMERIC, setPARAM, setPROMPT, setPROMPTEMPTY, setQUERY, setROEVENT, setSIZE, setupAutocomplete, setVALUE, validate, validateChangingValue, validateConcreteValue, validateNotNull, validateUnchangingValue, validateValueMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getBLANK, getCleaner, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getRO, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setDBLINK, setENABLED, setFUNCTION, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, appendAttribute, buildSetupScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, 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, 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
-
_key
-
_format
-
_nowrap
protected boolean _nowrap -
_code
-
_decodedValues
-
_staticView
-
_page
-
_panel
-
_reset
-
_search
-
_autoevent
-
_autoeventOnSet
protected boolean _autoeventOnSet -
_autoeventparam
-
_codetype
protected char _codetype -
keyType
protected char keyType -
_msgCerca
-
_msgSvuota
-
_msgCodice
-
-
Constructor Details
-
InputDecoder
public InputDecoder()Creates a new InputDecoder
-
-
Method Details
-
setKEY
Sets the name of the model field containing thekeyvalue -
setFORMAT
Sets the string that defines theMapFormatof the label that will be displayed in the not editable part of the field (on the right). Usually the format is defined in such a way that facilitates the readability (for example it reports the value of a description field). This attribute is mandatory.- Parameters:
s- The string that defines aMapFormat
-
setPAGE
Sets the path of the page that will be displayed when the user clicks on the magnifier button, triggering theonSearch(Object)event. This attribute must be prefixed by the underscore character (like: _page) to allows theUIFactorymechanism to resolve the correct path of the XML file.
Ideally this page contains a list representing the codes and theirs decoded values, and allows the users to directly select one of them. To return the selected value to the InputDecoder in the previous page, it is possible to pop the page from theWindowManagerpassing the selected record as parameter.- Parameters:
dp- The path of the page that lists the possible values to select
-
setPANEL
Sets theregistrynamethat identifies thePanelthat will be displayed when the user clicks on the magnifier button, triggering theonSearch(Object)event. The panel should contains a list representing the codes and theirs decoded values, and allows the user to directly select one of them. To return the selected value to the InputDecoder, it is possible to invoke thesetDecoding(HashGetter)method of the instance of the InputDecoder that has opened the panel- Parameters:
p- Theregistrynamethat identifies the panel that lists the possible values to select
-
setNOTNULL
Description copied from class:InputDefines 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- Overrides:
setNOTNULLin classInput- 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
-
setFULLSIZE
Description copied from class:InputIndicates if the field has to occupy all the available space in width- Overrides:
setFULLSIZEin classInput- 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
-
setPLACEHOLDER
Description copied from class:InputSets the placeholder, the short hint that usually describes the expected value that appears in the field before the user enters a value- Overrides:
setPLACEHOLDERin classInput- Parameters:
s- The string that will appear as a placeholder in the field
-
setAUTOEVENT
Sets the name of the event associated to the field and triggered when the user change the field value. By setting an autoevent, a form submit will be automatically performed when the field loses the focus.- Parameters:
s- The string that represents the name of the event associated to the field
-
setAUTOEVENTONSET
Defines whether the autoevent should be triggered or not when the decoded values have been programmatically set.- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0").
-
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
-
setCODETYPE
Sets the type of thecodevalue- Parameters:
s- Accepted values are: "long" to state that thecodevalue is a Long; "string" to state that thecodevalue is a String
-
setKEYTYPE
Sets the type of the key that the InputDecoder manages.- Parameters:
s- The type of the key. Possible values are:
- long
- string
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
nullEquals
-
getDa
Returns theDABaseassociated to the InputDecoder- Returns:
- The instance of the DABase object used by the InputDecoder
-
getDao
Returns theDAOassociated to the InputDecoder- Returns:
- The instance of the DAO object used by the InputDecoder
-
setSTATICVIEW
Sets the reference to theStaticViewthat will be used to extract the record from the data layer whose code match against the one 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 InputDecoder
-
setNOWRAP
Defines whether to wrap or not the field value- 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
-
setCODE
Sets the name of the model field containing thecodevalue- Parameters:
s- The name of thecodefield
-
prepareName
- Overrides:
prepareNamein classInput
-
prepareLongValue
-
prepareStringValue
-
setDecoding
Sets the decoded values of the InputDecoder, starting from the content of theHashGetterpassed as parameter, that must contain an entrykeyand an entrycode.- Parameters:
hg- The map that contains the decoded values
-
setValue
-
setCode
-
changeCollectedValue
-
getDecodeFromCodeQueryId
public int getDecodeFromCodeQueryId()Returns the specific query id used for the decoding. If it is set a specific query, withInput.setQUERY(String), the field uses that one for the decoding, instead of the standardDABase.SELECT_FILTER- Returns:
- The query id used for the decoding
-
getDecodeCommandFromCodeQueryId
Returns the specific query id used for the decoding. If it is set a specific query, withInput.setQUERY(String), the field uses that one for the decoding, instead of the standardDABase.SELECT_FILTER- Returns:
- The query id used for the decoding
-
getHtmlField
protected org.apache.ecs.Element getHtmlField() -
setEVENT
Description copied from class:InputSets 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).- Overrides:
setEVENTin classInput- 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 opens a page (setPAGE(String)) or shows aPanel(setPANEL(String). The page or panel should contains a list representing the codes and theirs decoded values, and should allows the user to directly select one of them.- Parameters:
o- Not used- Returns:
false
-
onDecode
Called to decode the value (when the user inputs the value and the field loses the focus, or when the user inputs the value and presses the tab key). At the end it calls the autoevent, if set (setAUTOEVENT(String))- Parameters:
o-HashGettercontaining the parameters to decode- 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(String))- Parameters:
o- Not used- Returns:
false
-
onRestore
Called when the InputDecoder is managed with the selection of the values on a new page (setPAGE(String)), and the user returns on the page that contains the field, after the choice of the value.
At the end it calls the autoevent, if set (setAUTOEVENT(String))- Parameters:
o- TheHashGetterthat contains the decoded values
-
getDescriptionHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the html code that represents the component description i.e. the formatted label of the field- Specified by:
getDescriptionHtmlin interfaceArrangeable- Overrides:
getDescriptionHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the label, or null if the field don't have it or is hidden
-
getHiddenHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the hidden but active html part of an hidden input field.- Specified by:
getHiddenHtmlin interfaceArrangeable- Overrides:
getHiddenHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the hidden part of the field or null if the field is visible.
-
getGenerationHandle
Description copied from class:InputImplements the interfaceArrangeable- Specified by:
getGenerationHandlein interfaceArrangeable- Overrides:
getGenerationHandlein classInput- Returns:
- null
-
getHtml
Description copied from class:InputReturns the html of the Input element -
getContentHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the html code that represents the active part of the input field, i.e. the field and the validation scripts- Specified by:
getContentHtmlin interfaceArrangeable- Overrides:
getContentHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the input field or null if the field don't have a graphical representation
-
manageNoDecodedValue
protected void manageNoDecodedValue(org.apache.ecs.ConcreteElement ce) -
buildDisplayScript
Description copied from class:InputEvery 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:
buildDisplayScriptin classInput- Parameters:
sb- The StringBuilder on which we want to add the script
-
isKeyStringType
protected final boolean isKeyStringType() -
getFilterCriteriaToRemove
protected Set<SqlOperator> getFilterCriteriaToRemove(Set<overit.geocall.ux.configurability.UIProperty> properties) - Overrides:
getFilterCriteriaToRemovein classInput
-