Class Form
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.Container
overit.geocall.basic.ui.container.Form
- All Implemented Interfaces:
Serializable,EntityContainer,ValuesContainer,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,AjaxableComponent,Badgeable,DraggableDroppable,Hideable,ContentChangeListener,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
- Direct Known Subclasses:
overit.geocallapp.wfm.schedulazione.manuale.attivitaschedulabili.CAttivitaSchedulabili,overit.geocallapp.wfm.schedulazione.manuale.attivitaurgenti.CAttivitaUrgenti,OutputForm,SchedulableBundles
@Component
public class Form
extends Container
implements ValuesContainer, EntityContainer, Hideable, AjaxableComponent, ContentChangeListener, DraggableDroppable
The class extends
Container and implements the html form element, the user interface element that allows to arranges the positions
and manages the behaviors of the child components, that are mainly input and output fields.- 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 HashGetterprotected Stringprotected Stringprotected Stringprotected charprotected HashGetterprotected Stringprotected SensibleHashGetterprotected Stringprotected StringFilter attribute used in copy and paste and drag and drop actions.protected LinkedHashSet<String> protected Stringprotected final HashMap<String, ValueValidator> Fields inherited from class overit.geocall.basic.ui.Container
_rofields, _rules, DALINK_NO, DALINK_YES, DATE_MAX, DATE_MIN, TIME_MAX, TIME_MIN, TYPE_ACTION, TYPE_BOOLEAN, TYPE_DATE, TYPE_DOUBLE, TYPE_DTZ, TYPE_EURO, TYPE_FILE, TYPE_FILES, TYPE_INTEGER, TYPE_LONG, TYPE_LONGARRAY, TYPE_MAP, TYPE_MAXDATE, TYPE_MAXTIME, TYPE_MEASURE, TYPE_MINDATE, TYPE_MINTIME, TYPE_NEWACTION, TYPE_STRING, TYPE_STRINGARRAY, TYPE_SUBSET, TYPE_SUBSETRANGE, TYPE_SUPPORT, TYPE_TIMERANGEFields 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, safeInlineServiceFields inherited from interface overit.geocall.ui.AjaxableComponent
FRAME_ID_PREFIX, NOTRANSITION, TRANSITION_BODY_MORPH, TRANSITION_BODY_RESIZE, TRANSITION_BORDER_RESIZE, TRANSITION_DOWN, TRANSITION_UP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEvery component can add a script to the StringBuilder, script executed when the component is created The method add the script that controls the validity of the fields of the formvoidchanged(overit.geocall.ux.servlet.processor.Change change) Implements theAjaxableComponentinterface.voidcollectEntities(String[] entities) Collects all the entities related to the containervoidcollectValues(HashGetter values, HashGetter daValues) Implements theValuesContainerinterface.protected voidconnect()voidImplements theContentChangeListenerinterface.drag(DragDrop.Part source) Implements theDraggableDroppableinterface.voiddragDrop(DragDrop.Part source, DragDrop.Part destination, boolean moving) Implements theDraggableDroppableinterface.voiddragged(DragDrop.Part source, DragDrop.Part destination, Object dragged, boolean moved) Implements theDraggableDroppableinterface.drop(DragDrop.Part source, DragDrop.Part destination, Object toDrop) Implements theDraggableDroppableinterface.Implements theValuesContainerinterface.Implements theValuesContainerinterface.overit.geocall.ux.servlet.processor.ChangeImplements theAjaxableComponentinterface.Gets the collected entities fo the containerGets theEntityValidatorrelated to the container.org.apache.ecs.ElementgetFrameHtml(overit.geocall.ux.servlet.processor.Change change, EntitySet es) Implements theAjaxableComponentinterface.org.apache.ecs.ElementReturns the html code of the formReturns the key label, used by theServerMultiFormgetLABEL()Returns the label associated to the formImplements theValuesContainerinterface.Gets the read only or not enabled fields registered into the values container.
If a ro or a not enabled field it has been registered, means that field won't be configurable and it will be seeked from the server at every submit.getSeek()Gets the set of must-seek fieldsReturns the letter of the label (setLABEL(s)), the readonly label (setROLABEL(s)) or the blank label (setBLANKLABEL(s)), used as shortcut to switch to the form, when inserted into aServerMultiForm, pressing ALT + the letter used as shortcutbooleanDeprecated.booleanGets if the container is a filter or an edit containerbooleanChecks if the form is rendered for the user currently logged in the application, or not (seegetBoolean(visible,id,true))voidregisterReadOnlyAndNotEnabledField(String fieldName, Control c) Register into the valuesContainer a read only or a not enabled field.
Registering a ro or a not enabled field means that this field won't be configurable and it will be seeked from the server at every submit.voidregisterSeek(String name) registers a validator for values that will arrivevoidregisterValidator(String name, ValueValidator vv) registers a validator for valuesthat will arrivevoidremoveFromSeek(String name) remove a validator from the values that will arrivevoidSanitize collected values by removing those that should not be kept in memory/session (e.g.protected voidvoidAdds the anchor html attribute to the formvoidSets the label shown when the form is inblankstate.voidSets the label shown when the form is inblankstatevoidsetCollectedValues(HashGetter values, HashGetter daValues) Implements theValuesContainerinterface.voidSpecifies if the form (and therefore all its values) can be dragged to another (droppable) componentvoidSpecifies if the user can drop some values from another (draggable) component into the formvoidSets the entities related to this formvoidSets if the form will be used without persists data on db.
A Form is harmelss when it doesn't perform insert, delete and/or update operations on the data layer.voidSets the label of the formvoidDefines the submit mechanism used by the formvoidDefines the way in which the values are managed on every event.voidsetROLABEL(String s) Sets the label shown when the form is inreadonlystatevoidAdds the role html attribute to the form.
This attirbute is needed due to accessibility reason, for example to set the role="search" on a form that it's used to research some records.voidSets the must-seek fields.voidSets seek condition.voidsetVISIBLE(String s) Defines if the form should be rendered or notvoidSets a particularxclassto the form; this string is used to limit the operations of copy / cut / paste / drag / drop that can be executed only between objects that have the samexclassattribute.voidvalidateValues(Map arriving, boolean strong) validate the arriving values against the regisgtered validatorsMethods inherited from class overit.geocall.basic.ui.Container
alert, applyRule, getBASIC, getBLANK, getRO, getROField, onClose, onOpen, onOpenChildContainer, onRestore, onRule, prepareName, rulesNewValues, setROField, setValues, setValuesMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getCleaner, getConfigurableProperties, getDAValues, getDBLINK, 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, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, 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, 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, setICON, setIdentity, setIMPORTANT, setLabel, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setup, 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
-
_values
-
_pubValues
-
_daValues
-
_method
-
_anchor
-
_rolabel
-
_blanklabel
-
_visible
-
_mode
protected char _mode -
_draggable
-
_droppable
-
role
-
autoSeek
-
seek
-
seekCondition
-
entities
-
validators
-
_xclass
Filter attribute used in copy and paste and drag and drop actions. We can paste / drop the content only if the origin object has the same xclass of the destination object
-
-
Constructor Details
-
Form
public Form()Creates a new instance of Form
-
-
Method Details
-
connect
protected void connect() -
setSEEK
Sets the must-seek fields.- Parameters:
ss- String containing the must-seek fields. Accepted values are:- 'auto': only control field like 'read only', 'not null' and 'hidden' field will be validated (field with a 'registryname' will not be considered). It is possible to add more field to validate by adding them after 'auto' using this syntax: 'auto,+AUSENAME' and it is possible to not validate one or more field by subtract it using this syntax: 'auto,-AUSENAME';
- 'full': every single field in the form will be validated, it is possible to not validate one or more field by subtract it using this syntax: 'full,-AUSENAME';
- string containing the list of all the added field to validate separated with a comma, for example: '+AUSENAME,+AUSEDATE'.
Form. For this purpose the seek attribute can be set in this way:seek="auto,-registered,-notDbLinked,....".
-
setSEEKCONDITION
Sets seek condition. Used only in some particular cases, the use is not recommended.- Parameters:
ss- String containing the seek condition
-
setHARMLESS
Sets if the form will be used without persists data on db.
A Form is harmelss when it doesn't perform insert, delete and/or update operations on the data layer.- Parameters:
s-"true" or "1"if the form is a filter form,"false" or "0"otherwise.
-
isHarmlessContainer
public boolean isHarmlessContainer()Description copied from interface:ValuesContainerGets if the container is a filter or an edit container- Specified by:
isHarmlessContainerin interfaceValuesContainer- Returns:
trueif is a filter container,falseotherwise.
-
getSeek
Gets the set of must-seek fields- Returns:
- The set of must-seek fields
-
setDRAGGABLE
Specifies if the form (and therefore all its values) can be dragged to another (droppable) component- Parameters:
s- A string that defines if the form is draggable, and the behavior of the dragging. The possible accepted values are:
"+" the drag operation copies the form values;
"-" the drag operation removes the form values;
"+-" the drag operation copies or removes the form values depending on whether the CTRL key is pressed or not during the drag operation.
-
setDROPPABLE
Specifies if the user can drop some values from another (draggable) component into the form- Parameters:
s- A string that defines if the form accepts the drop of values from another component. The possible value is: "f" (any other value works in the same way, but we strongly suggest using the letter "f" to avoid any future conflicts due to developments on the component behavior
-
setXCLASS
Sets a particularxclassto the form; this string is used to limit the operations of copy / cut / paste / drag / drop that can be executed only between objects that have the samexclassattribute. If no value is specified, there aren't restriction imposed; otherwise a value can be pasted / dropped on the form only if the source component has the samexclassvalue- Parameters:
xclass- The string that defines thexclassfor the form
-
setMETHOD
Defines the submit mechanism used by the form- Parameters:
s- The string that defines the submit mechanism. Possible values are:
"POST": submit the values using POST HTTP method
"FILE": submit a multipart request using POST method. This attribute value should be used if the form contains anInputUploadfield
-
setANCHOR
Adds the anchor html attribute to the form- Parameters:
s- The string that defines the value of the anchor attribute
-
setROLE
Adds the role html attribute to the form.
This attirbute is needed due to accessibility reason, for example to set the role="search" on a form that it's used to research some records.- Parameters:
r- The string that defines the value of the role attribute
-
setVISIBLE
Defines if the form should be rendered or not- Specified by:
setVISIBLEin interfaceHideable- Parameters:
s- A string that represent a boolean value ("true" or "1", "false" or "0") or a function.
If the string is not recognized as a boolean value, it is considered as a user function with this meaning: if the user currently logged in the application has the function, the form will be rendered, otherwise it will not
-
getVISIBLE
public boolean getVISIBLE()Deprecated.UseisVisible()instead- Specified by:
getVISIBLEin interfaceHideable- Returns:
- Use
isVisible()instead
-
isVisible
public boolean isVisible()Checks if the form is rendered for the user currently logged in the application, or not (seegetBoolean(visible,id,true)) -
getLABEL
Returns the label associated to the form- Overrides:
getLABELin classControl- Returns:
- A string that represents the label of the form.
It is possible to define a shortcut letter, see
Component.calcLabel(s)
-
getSHORTCUT
Returns the letter of the label (setLABEL(s)), the readonly label (setROLABEL(s)) or the blank label (setBLANKLABEL(s)), used as shortcut to switch to the form, when inserted into aServerMultiForm, pressing ALT + the letter used as shortcut- Overrides:
getSHORTCUTin classComponent- Returns:
- The letter used as shortcut
-
getKEYLABEL
Returns the key label, used by theServerMultiForm- Overrides:
getKEYLABELin classControl- Returns:
- The string that represents the key label
It is possible to define a shortcut letter, see
Component.calcLabel(s)
-
setLABEL
Sets the label of the form -
setROLABEL
Sets the label shown when the form is inreadonlystate- Parameters:
s- The string that will be used as label for the form inreadonlystate
-
setBLANKLABEL
Sets the label shown when the form is inblankstate- Parameters:
s- The string that will be used as label for the form inblankstate
-
setBlankLabel
Sets the label shown when the form is inblankstate. Using this method the label passed as a parameter will not be processed by the translation mechanism and will remain unchanged even after a change of language- Parameters:
s- The string that will be used as label for the form inblankstate
-
getHtml
Returns the html code of the form -
changed
public void changed(overit.geocall.ux.servlet.processor.Change change) Implements theAjaxableComponentinterface. It defines the morphing of the form element that occurs when there is an Ajax interaction- Specified by:
changedin interfaceAjaxableComponent- Parameters:
change- TheChangeobject that defines the specific morphing type for the form
-
getDefaultChange
public overit.geocall.ux.servlet.processor.Change getDefaultChange()Implements theAjaxableComponentinterface. It defines the defaultChangeobject for the form- Specified by:
getDefaultChangein interfaceAjaxableComponent- Returns:
- The default
Changeobject that defines the default morphing type of the form
-
getFrameHtml
public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change change, EntitySet es) Implements theAjaxableComponentinterface. It defines the html part of the form that changes when an Ajax interaction occurs- Specified by:
getFrameHtmlin interfaceAjaxableComponent- Parameters:
change- TheChangeobject that defines the specific morphing type for the formes- TheEntitySetto which the element belongs- Returns:
- The html part of the form that changes when an Ajax interaction occurs
-
setMODE
Defines the way in which the values are managed on every event.- Parameters:
mode- A string that defines the way in which the values are managed. Possible values are:
"r": reload mode (this is the default mode); the form values are reloaded on every event (form refresh, tab switch, etc.)
"a": append mode; the form values are appended / updated on every event (form refresh, tab switch, etc.))
-
collectValues
Implements theValuesContainerinterface. It is used to collect the form values- Specified by:
collectValuesin interfaceValuesContainer- Parameters:
values- TheHashGetterthat contains the values of the form otherwise only the validations to avoid tampering of parameters must be executeddaValues- TheHashGetterthat contains the DA values of the form
-
setCollectedValues
Implements theValuesContainerinterface. It is used to set the collected values of the form- Specified by:
setCollectedValuesin interfaceValuesContainer- Parameters:
values- TheHashGetterthat contains the values of the formdaValues- TheHashGetterthat contains the DA values of the form
-
getCollectedValues
Implements theValuesContainerinterface. It returns the collected values of the form- Specified by:
getCollectedValuesin interfaceValuesContainer- Returns:
- An
HashGetterthat contains the collected values of the form
-
getCollectedDAValues
Implements theValuesContainerinterface. It returns the collected DA values of the form- Specified by:
getCollectedDAValuesin interfaceValuesContainer- Returns:
- An
HashGetterthat contains the collected DA values of the form
-
getPublishedValues
Implements theValuesContainerinterface. It returns the published values of the form- Specified by:
getPublishedValuesin interfaceValuesContainer- Returns:
- An
HashGetterthat contains the published values of the form
-
getReadOnlyAndNotEnabledFields
Description copied from interface:ValuesContainerGets the read only or not enabled fields registered into the values container.
If a ro or a not enabled field it has been registered, means that field won't be configurable and it will be seeked from the server at every submit.- Specified by:
getReadOnlyAndNotEnabledFieldsin interfaceValuesContainer- Returns:
- the read only or not enabled fields registered into the values container.
-
registerReadOnlyAndNotEnabledField
Description copied from interface:ValuesContainerRegister into the valuesContainer a read only or a not enabled field.
Registering a ro or a not enabled field means that this field won't be configurable and it will be seeked from the server at every submit.- Specified by:
registerReadOnlyAndNotEnabledFieldin interfaceValuesContainer- Parameters:
fieldName- The name of the fieldc- The field.
-
contentChanged
public void contentChanged()Implements theContentChangeListenerinterface. It calls theComponent.changed()method.- Specified by:
contentChangedin interfaceContentChangeListener
-
dragDrop
Implements theDraggableDroppableinterface. It is the method that implements the operation of drag and drop on the same object. In the case of the form the method is empty because this kind of interaction is not useful- Specified by:
dragDropin interfaceDraggableDroppable- Parameters:
source- The source object, from where we are draggingdestination- The destination object, where we are droppingmoving- true if the operation removes the values dragged from the source (like a cut operation), false otherwise (like a copy operation)
-
drag
Implements theDraggableDroppableinterface. It is the method that implements the operation of drag from the form- Specified by:
dragin interfaceDraggableDroppable- Parameters:
source- The form element from which we are dragging- Returns:
- The values of the form that we are dragging
- Throws:
DragDropException- If an error occurs during the drag operation, a DragDropException is raised
-
dragged
public void dragged(DragDrop.Part source, DragDrop.Part destination, Object dragged, boolean moved) throws DragDropException Implements theDraggableDroppableinterface. It is the method called when the object is dropped- Specified by:
draggedin interfaceDraggableDroppable- Parameters:
source- The source object, from which we are draggingdestination- The destination object, the form element on which we are droppingdragged- The object that we want to drop on the formmoved- true if the operation removes the values dragged from the source (like a cut operation), false otherwise (like a copy operation)- Throws:
DragDropException- f an error occurs during the operation, a DragDropException is raised
-
drop
public Object drop(DragDrop.Part source, DragDrop.Part destination, Object toDrop) throws DragDropException Implements theDraggableDroppableinterface. It is the method that implements the operation of drop on the form- Specified by:
dropin interfaceDraggableDroppable- Parameters:
source- The source object, from which we are draggingdestination- The destination object, the form element on which we are droppingtoDrop- The object that we want to drop on the form- Returns:
- The object dropped, or null if the operation of drop is not possible
- Throws:
DragDropException- If an error occurs during the drop operation, a DragDropException is raised
-
setENTITY
Sets the entities related to this form- Parameters:
s- The list of the entities separated by a comma
-
getEntities
Description copied from interface:EntityContainerGets the collected entities fo the container- Specified by:
getEntitiesin interfaceEntityContainer- Returns:
- The collected entities
-
collectEntities
Description copied from interface:EntityContainerCollects all the entities related to the container- Specified by:
collectEntitiesin interfaceEntityContainer- Parameters:
entities- The entities to collect
-
buildSetupScript
Every component can add a script to the StringBuilder, script executed when the component is created The method add the script that controls the validity of the fields of the form- Overrides:
buildSetupScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
registerValidator
Description copied from interface:ValuesContainerregisters a validator for valuesthat will arrive- Specified by:
registerValidatorin interfaceValuesContainer- Parameters:
name- the name of the validator, that is the name of the arriving variable or the name concatenated with an _* if the variabile is an indexed variablevv- the validator instance
-
getEntityValidator
Description copied from interface:EntityContainerGets theEntityValidatorrelated to the container.- Specified by:
getEntityValidatorin interfaceEntityContainer- Returns:
- The
EntityValidatorrelated to the container.
-
registerSeek
Description copied from interface:ValuesContainerregisters a validator for values that will arrive- Specified by:
registerSeekin interfaceValuesContainer- Parameters:
name- the name of a field that must be seeked in every values validation
-
removeFromSeek
Description copied from interface:ValuesContainerremove a validator from the values that will arrive- Specified by:
removeFromSeekin interfaceValuesContainer- Parameters:
name- the name of a field that won't be seeked anymore
-
seek
- Throws:
ValidationException
-
validateValues
Description copied from interface:ValuesContainervalidate the arriving values against the regisgtered validators- Specified by:
validateValuesin interfaceValuesContainer- Parameters:
arriving- the values that has been pisted through an eventstrong- if true the values validaton needs to be complete, otherwise only the validations to avoid tampering of parameters must be executed
-
sanitizeValues
public void sanitizeValues()Description copied from interface:ValuesContainerSanitize collected values by removing those that should not be kept in memory/session (e.g. UpFiles)- Specified by:
sanitizeValuesin interfaceValuesContainer
-
isVisible()instead