Package overit.geocall.basic.ui.control
Class ResponsiveGrid
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.ResponsiveGrid
- All Implemented Interfaces:
Serializable,EntityContainer,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,AjaxableComponent,Arrangeable,Badgeable,Hideable,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
@Component
@Configurable
@Ignore("LABELINLINE")
@ConfigurableAttribute(name="CLOSABLE",
label="Closable",
type="BOOLEAN")
public class ResponsiveGrid
extends Control
implements Hideable, Arrangeable, AjaxableComponent, EntityContainer
This component is used to organize the components that belong to it within a grid.
The particularity of ResponsiveGrid lies in the ability to adapt the grid's
The following is an example of use:
The Layout component only takes effect within the ResponsiveGrid and defines the arrangement, referencing it or via the corresponding
As you can see, the example shows different definitions of Layout, associated each with a different dimension; for further information, refer to the documentation of the component
Layout according to the
size of the window/workarea thus allowing the components to be arranged so that they are always better displayed avoiding
the horizontal scroll of the page.The following is an example of use:
<ResponsiveGrid spacing="control" >
<Layout size="xs" mode="control">
NAME
SURNAME
EMAIL
</Layout>
<Layout size="sm" mode="arranging">
NAME
SURNAME
EMAIL
</Layout>
<Layout size="md" mode="arranging">
NAME SURNAME
EMAIL EMAIL
</Layout>
<Layout size="lg" mode="control">
NAME SURNAME EMAIL
</Layout>
<Layout size="xl" mode="arranging">
NAME SURNAME EMAIL
</Layout>
<Input name="AUSENAME" layoutName="NAME" label="Name"/>
<Input name="AUSESURNAME" layoutName="SURNAME" label="Surname"/>
<Input name="AUSEEMAIL" layoutName="EMAIL" label="Email"/>
</ResponsiveGrid>
The structure requires to record a set of layouts that define the arrangement of the components, then the list of components.
The order of definition of the components is not important because the position is controlled exclusively by the layouts.The Layout component only takes effect within the ResponsiveGrid and defines the arrangement, referencing it or via the corresponding
LAYOUTNAME (as shown in the example) or, without this, via the NAME.As you can see, the example shows different definitions of Layout, associated each with a different dimension; for further information, refer to the documentation of the component
Layout.- 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 booleanprotected booleanprotected State.Confprotected booleanprotected Stringprotected booleanprotected Layout.Spacingprotected Layout.Targetprotected SetPredicatestatic final Stringprotected Booleanprotected HashMap<Layout.Size, Layout> protected booleanFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanGets if the grid has at least a Layout that present a user configuration.voidEvery component can add a script to the StringBuilder, script executed when the component is displayed.voidEvery component can add a script to the StringBuilder, script executed when the component is created.voidchanged(overit.geocall.ux.servlet.processor.Change change) Defines the morphing of the element that occurs when there is an Ajax interactionvoidcollectEntities(String[] entities) Collects all the entities related to the containerprotected overit.geocall.basic.ui.control.Layout.AreaGets all the children of the responsiveGrid including any extended fields relating to the entities defined for the grid.
All extended fields are taken into consideration, even those not yet included in the user configurationprotected org.apache.ecs.ElementgetChildContent(EntitySet es, Component c, overit.geocall.basic.ui.control.Layout.Area area) protected org.apache.ecs.ElementgetChildDescription(EntitySet es, Component c, overit.geocall.basic.ui.control.Layout.Area area) booleanGet if the grid is closable.Collection<overit.geocall.ux.configurability.UIProperty> Gets a set ofUIPropertyobject that represents the configurable UI properties that the object can handle.
EachUIPropertyobject, 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.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 scriptsoverit.geocall.ux.servlet.processor.ChangeDefines the defaultChangeobject for the elementorg.apache.ecs.ElementgetDescriptionHtml(Object generationhandle, EntitySet es) Returns the html code that represents the component description i.e. the formatted label of the fieldGets the list of the entities related to the grid.Gets theEntityValidatorrelated to the container.getExtendedAttributes(String entityName) getExtendedAttributesLayoutNames(String entityName) org.apache.ecs.ElementgetFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es) Defines the html part of the element that changes when an Ajax interaction occursReturns the object to generate when the Arrangeable element is composed by more than one elementprotected org.apache.ecs.ElementgetGridHtml(EntitySet es) org.apache.ecs.ElementgetHiddenHtml(Object generationhandle, EntitySet es) Returns the hidden but active html part of an hidden componentorg.apache.ecs.ElementAbstract method that must be extended and returns the html code of the Componentprotected org.apache.ecs.ElementReturns the published childs.getRef()Returns the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax eventbooleanGet if the grid is set to closed when it is in read-only mode.Gets the spacing used between one grid's component and another.Return the largest defined layout that can be rendered in the give size.Gets the responsiveGrid target.booleanprotected booleanvoidinitChilds(Container parent) Call theComponent.onInit(Container)method of all the childrens (seeUINode.getChildren()) of the ComponentvoidInvalidates the map that contains all the user's component customization and force it to be reloaded.static booleanisAllowedConfigurationState(String confState) booleanisClosed()Check if the grid is closedbooleanGets if the grid is editable or not.booleanChecks the visibility of the componentvoidRecreates and recalculates all Grid's layout.voidRemove layout that belong to the specificLayout.Sizepassed as parameters, form the managed layout by this Grid.voidSets the possibility to closed the grid, as long as this is inside aResponsiveGridFrame.voidsetClosed(boolean closed) Set the Grid close statevoidIf the grid is closable, set the status of the grid at first time you visit the page having it.voidsetConfiguredProperty(Map<String, Serializable> properties) Apply the user's properties customization into the component.voidSets if the grid is editable or not.voidSets the entities related to this gridvoidSets the horizontal size of the grid to fullsize.voidDefines the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax eventvoidSets the grid to closed when it is read-only.voidsetSPACING(String s) Defines the spacing used between one grid's component and another.voidIndicates whether the layout should be chosen considering the size of the window rather than the workarea.protected voidsetup()Setup the ComponentvoidvoidsetVISIBLE(String s) Sets the visibility of the componentMethods 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, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setDBLINK, setENABLED, setFUNCTION, setModelProperties, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, 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, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, 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, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, 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
-
CLOSABLE_ATTRIBUTE
- See Also:
-
_visible
-
_closable
protected boolean _closable -
_closed
protected boolean _closed -
_roclosed
protected boolean _roclosed -
_ref
-
_fullSize
protected boolean _fullSize -
configuredClosable
-
_conf
-
_target
-
_spacing
-
_layouts
-
configuredLayouts
-
_visibleComponents
-
editable
protected boolean editable
-
-
Method Details
-
setCLOSABLE
Sets the possibility to closed the grid, as long as this is inside aResponsiveGridFrame. Moreover it is necessary to set a label to the grid (seesetLABEL()) to enable the possibility to close it. If you don't want to write anything into the label, it is possible to leave empty the label value.- Parameters:
s- String containing the boolean value to enable closable mode or not.
-
setCLOSED
If the grid is closable, set the status of the grid at first time you visit the page having it. The next time the status will be recovered from the database to restore the last active state.- Parameters:
s- String containing the boolean value to set the grid in the closed state or not.
-
setTARGET
Indicates whether the layout should be chosen considering the size of the window rather than the workarea. In the first case, the grid will react only after resizing the browser window, while in the second case it will also on the TaskBar open/close.- Parameters:
s- String indicates if take into account the work area or the viewport to choose the correct layout. The accepted values ??are:- wa: resizing based on the size of the WorkArea (default)
- vp: resizing based on the size of the ViewPort
-
getTarget
Gets the responsiveGrid target. Target attribute indicates whether the layout should be chosen considering the size of the window rather than the workarea. In the first case, the grid will react only after resizing the browser window, while in the second case it will also on the TaskBar open/close.- Returns:
Layout.Target
-
setREF
Defines the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax event- Parameters:
s- The name of the reference that must correspond to the name of an anchor
-
setROCLOSED
Sets the grid to closed when it is read-only.- Parameters:
s- String containing the boolean value to set the grid in the closed state when it is read-only.
-
setSPACING
Defines the spacing used between one grid's component and another.- Parameters:
s- The accepted values ??are:- control: standard spacing to use when components are
Control(default) - container: increased spacing, to be used when the components are
Containers
- control: standard spacing to use when components are
-
getSpacing
Gets the spacing used between one grid's component and another.- Returns:
Layout.Spacing
-
setFULLSIZE
Sets the horizontal size of the grid to fullsize. So, when it is set totrue, the width of the grid will occupy all the space possible- Parameters:
s- String containing the boolean value to enable fullsize mode or not.
-
setEDITABLE
Sets if the grid is editable or not. If it is editable hovering the upper right corner of the component, the edit icon will be shown and clicking it will be possible to show the configure panel for the grid.- Parameters:
s-trueorfalse
-
isEditable
public boolean isEditable()Gets if the grid is editable or not. If it is editable hovering the upper right corner of the component, the edit icon will be shown and clicking it will be possible to show the configure panel for the grid.- Returns:
trueif it is editable,falseotherwise
-
getRef
Returns the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax event- Returns:
- s The name of the reference, that correspond to the name of an anchor
-
getClosable
public boolean getClosable()Get if the grid is closable.- Returns:
- The boolean to know if the grid is closable.
-
getROClosed
public boolean getROClosed()Get if the grid is set to closed when it is in read-only mode.- Returns:
- The boolean to know if the grid is set to closed in read-only mode.
-
isClosed
public boolean isClosed()Check if the grid is closed- Returns:
trueif the grid is open,falseotherwise
-
setClosed
public void setClosed(boolean closed) Set the Grid close state- Parameters:
closed-trueto close the grid,falseotherwise
-
setENTITY
Sets the entities related to this grid- Parameters:
s- The list of the entities separated by a comma
-
getEntities
Gets the list of the entities related to the grid.- Specified by:
getEntitiesin interfaceEntityContainer- Returns:
- the list of the entities related to the grid.
-
getEntityValidator
Description copied from interface:EntityContainerGets theEntityValidatorrelated to the container.- Specified by:
getEntityValidatorin interfaceEntityContainer- Returns:
- The
EntityValidatorrelated to the container.
-
collectEntities
Description copied from interface:EntityContainerCollects all the entities related to the container- Specified by:
collectEntitiesin interfaceEntityContainer- Parameters:
entities- The entities to collect
-
getSupportedLayout
Return the largest defined layout that can be rendered in the give size.- Parameters:
size- The desired size for the layout- Returns:
- instance of the layout or null if there's no layout that can be rendered in the given size.
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
initChilds
Description copied from class:ComponentCall theComponent.onInit(Container)method of all the childrens (seeUINode.getChildren()) of the Component- Overrides:
initChildsin classComponent- Parameters:
parent- The component of which we want to initialize the children
-
addExtendAttributesAndSetupThem
public void addExtendAttributesAndSetupThem() -
getExtendedAttributes
-
getExtendedAttributes
-
setupFilterCriteriaOnChildren
public void setupFilterCriteriaOnChildren() -
getExtendedAttributesLayoutNames
-
getAllExtendedAttributesLayoutNames
-
invalidateComponentsAttributeMap
public void invalidateComponentsAttributeMap()Invalidates the map that contains all the user's component customization and force it to be reloaded. -
reloadLayouts
public void reloadLayouts()Recreates and recalculates all Grid's layout. -
removeLayoutFromSize
Remove layout that belong to the specificLayout.Sizepassed as parameters, form the managed layout by this Grid.- Parameters:
s- the specificLayout.Sizeobject passed as parameters, to identify the layout to remove.
-
getHtml
Description copied from class:ComponentAbstract method that must be extended and returns the html code of the Component -
getFrameHtml
public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es) Description copied from interface:AjaxableComponentDefines the html part of the element that changes when an Ajax interaction occurs- Specified by:
getFrameHtmlin interfaceAjaxableComponent- Parameters:
c- TheChangeobject that defines the specific morphing type for the elementes- TheEntitySetto which the element belongs- Returns:
- The html part of the element that changes when an Ajax interaction occurs
-
getGenerationHandle
Description copied from interface:ArrangeableReturns the object to generate when the Arrangeable element is composed by more than one element- Specified by:
getGenerationHandlein interfaceArrangeable- Returns:
- The Object to generate
-
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- 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- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the component
-
getHiddenHtml
Description copied from interface:ArrangeableReturns the hidden but active html part of an hidden component- Specified by:
getHiddenHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the hidden part of the component
-
getLayoutHtml
-
getGridHtml
-
getChildDescription
-
getChildContent
-
getPublishedChildrenList
Description copied from class:ComponentReturns the published childs. Those that are not published are not even searched to be synchronized via Ajax- Overrides:
getPublishedChildrenListin classComponent- Returns:
- The
Listof published childs
-
buildDisplayScript
Description copied from class:ComponentEvery component can add a script to the StringBuilder, script executed when the component is displayed.- Overrides:
buildDisplayScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
buildSetupScript
Description copied from class:ComponentEvery component can add a script to the StringBuilder, script executed when the component is created.- Overrides:
buildSetupScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
setVISIBLE
Description copied from interface:HideableSets the visibility of the component- Specified by:
setVISIBLEin interfaceHideable- Parameters:
s- String used to defines the visibility of the component
-
getVISIBLE
public boolean getVISIBLE()- Specified by:
getVISIBLEin interfaceHideable- Returns:
- Use
Hideable.isVisible()
-
isVisible
public boolean isVisible()Description copied from interface:HideableChecks the visibility of the component -
hasVisibleComponents
protected boolean hasVisibleComponents() -
findArea
-
atLeastALayoutHasAChanged
public boolean atLeastALayoutHasAChanged()Gets if the grid has at least a Layout that present a user configuration.- Returns:
- if the grid has at least a Layout that present a user configuration.
-
changed
public void changed(overit.geocall.ux.servlet.processor.Change change) Description copied from interface:AjaxableComponentDefines the morphing of the element that occurs when there is an Ajax interaction- Specified by:
changedin interfaceAjaxableComponent- Parameters:
change- TheChangeobject that defines the specific morphing type for the element
-
getDefaultChange
public overit.geocall.ux.servlet.processor.Change getDefaultChange()Description copied from interface:AjaxableComponentDefines the defaultChangeobject for the element- Specified by:
getDefaultChangein interfaceAjaxableComponent- Returns:
- The default
Changeobject that defines the default morphing type of the element
-
isAllowedConfigurationState
-
getAllResponsiveGridChildren
Gets all the children of the responsiveGrid including any extended fields relating to the entities defined for the grid.
All extended fields are taken into consideration, even those not yet included in the user configuration- Returns:
- all the children of the responsiveGrid including any extended fields relating to the entities defined for the grid.
-
setConfiguredProperty
Description copied from interface:overit.geocall.ux.configurability.UIConfigurableApply the user's properties customization into the component.- Specified by:
setConfiguredPropertyin interfaceoverit.geocall.ux.configurability.UIConfigurable- Overrides:
setConfiguredPropertyin classControl- Parameters:
properties- The map containing the configured properties to set
-
getConfigurableProperties
Description copied from interface:overit.geocall.ux.configurability.UIConfigurableGets a set ofUIPropertyobject that represents the configurable UI properties that the object can handle.
EachUIPropertyobject, 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:
getConfigurablePropertiesin interfaceoverit.geocall.ux.configurability.UIConfigurable- Overrides:
getConfigurablePropertiesin classControl- Returns:
- object that represents the configurable UI properties that the object can handle.
-