Class 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 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
  • Field Details

    • CLOSABLE_ATTRIBUTE

      public static final String CLOSABLE_ATTRIBUTE
      See Also:
    • _visible

      protected SetPredicate _visible
    • _closable

      protected boolean _closable
    • _closed

      protected boolean _closed
    • _roclosed

      protected boolean _roclosed
    • _ref

      protected String _ref
    • _fullSize

      protected boolean _fullSize
    • configuredClosable

      protected Boolean configuredClosable
    • _conf

      protected State.Conf _conf
    • _target

      protected Layout.Target _target
    • _spacing

      protected Layout.Spacing _spacing
    • _layouts

      protected TreeSet<Layout> _layouts
    • configuredLayouts

      protected HashMap<Layout.Size,Layout> configuredLayouts
    • _visibleComponents

      protected ArrayList<Component> _visibleComponents
    • editable

      protected boolean editable
  • Method Details

    • setCLOSABLE

      public void setCLOSABLE(String s)
      Sets the possibility to closed the grid, as long as this is inside a ResponsiveGridFrame. Moreover it is necessary to set a label to the grid (see setLABEL()) 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

      public void setCLOSED(String s)
      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

      public void setTARGET(String s)
      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

      public Layout.Target 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

      public void setREF(String s)
      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

      public void setROCLOSED(String s)
      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

      public void setSPACING(String s)
      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
    • getSpacing

      public Layout.Spacing getSpacing()
      Gets the spacing used between one grid's component and another.
      Returns:
      Layout.Spacing
    • setFULLSIZE

      public void setFULLSIZE(String s)
      Sets the horizontal size of the grid to fullsize. So, when it is set to true, 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

      public void setEDITABLE(String s)
      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 - true or false
    • 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:
      true if it is editable, false otherwise
    • getRef

      public String 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:
      true if the grid is open, false otherwise
    • setClosed

      public void setClosed(boolean closed)
      Set the Grid close state
      Parameters:
      closed - true to close the grid, false otherwise
    • setENTITY

      public void setENTITY(@NotNull @NotNull String s)
      Sets the entities related to this grid
      Parameters:
      s - The list of the entities separated by a comma
    • getEntities

      public Set<String> getEntities()
      Gets the list of the entities related to the grid.
      Specified by:
      getEntities in interface EntityContainer
      Returns:
      the list of the entities related to the grid.
    • getEntityValidator

      public EntityValidator getEntityValidator()
      Description copied from interface: EntityContainer
      Gets the EntityValidator related to the container.
      Specified by:
      getEntityValidator in interface EntityContainer
      Returns:
      The EntityValidator related to the container.
    • collectEntities

      public void collectEntities(String[] entities)
      Description copied from interface: EntityContainer
      Collects all the entities related to the container
      Specified by:
      collectEntities in interface EntityContainer
      Parameters:
      entities - The entities to collect
    • getSupportedLayout

      public Layout getSupportedLayout(Layout.Size size)
      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: Component
      Setup the Component
      Overrides:
      setup in class Component
    • initChilds

      public void initChilds(Container parent)
      Description copied from class: Component
      Call the Component.onInit(Container) method of all the childrens (see UINode.getChildren()) of the Component
      Overrides:
      initChilds in class Component
      Parameters:
      parent - The component of which we want to initialize the children
    • addExtendAttributesAndSetupThem

      public void addExtendAttributesAndSetupThem()
    • getExtendedAttributes

      public Collection<Component> getExtendedAttributes()
    • getExtendedAttributes

      public Set<DataAttribute> getExtendedAttributes(String entityName)
    • setupFilterCriteriaOnChildren

      public void setupFilterCriteriaOnChildren()
    • getExtendedAttributesLayoutNames

      public Set<String> getExtendedAttributesLayoutNames(String entityName)
    • getAllExtendedAttributesLayoutNames

      public Set<String> 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

      public void removeLayoutFromSize(Layout.Size s)
      Remove layout that belong to the specific Layout.Size passed as parameters, form the managed layout by this Grid.
      Parameters:
      s - the specific Layout.Size object passed as parameters, to identify the layout to remove.
    • getHtml

      public org.apache.ecs.Element getHtml(EntitySet es)
      Description copied from class: Component
      Abstract method that must be extended and returns the html code of the Component
      Specified by:
      getHtml in class Component
      Parameters:
      es - The EntitySet to which the element belongs
      Returns:
      The html of the Component
    • getFrameHtml

      public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es)
      Description copied from interface: AjaxableComponent
      Defines the html part of the element that changes when an Ajax interaction occurs
      Specified by:
      getFrameHtml in interface AjaxableComponent
      Parameters:
      c - The Change object that defines the specific morphing type for the element
      es - The EntitySet to which the element belongs
      Returns:
      The html part of the element that changes when an Ajax interaction occurs
    • getGenerationHandle

      public Object getGenerationHandle()
      Description copied from interface: Arrangeable
      Returns the object to generate when the Arrangeable element is composed by more than one element
      Specified by:
      getGenerationHandle in interface Arrangeable
      Returns:
      The Object to generate
    • 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
      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
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the component
    • getHiddenHtml

      public org.apache.ecs.Element getHiddenHtml(Object generationhandle, EntitySet es)
      Description copied from interface: Arrangeable
      Returns the hidden but active html part of an hidden component
      Specified by:
      getHiddenHtml in interface Arrangeable
      Parameters:
      generationhandle - the unique generatin handle
      es - the page entity set
      Returns:
      The html code of the hidden part of the component
    • getLayoutHtml

      protected org.apache.ecs.Element getLayoutHtml(EntitySet es)
    • getGridHtml

      protected org.apache.ecs.Element getGridHtml(EntitySet es)
    • getChildDescription

      protected org.apache.ecs.Element getChildDescription(EntitySet es, Component c, overit.geocall.basic.ui.control.Layout.Area area)
    • getChildContent

      protected org.apache.ecs.Element getChildContent(EntitySet es, Component c, overit.geocall.basic.ui.control.Layout.Area area)
    • getPublishedChildrenList

      public List getPublishedChildrenList()
      Description copied from class: Component
      Returns the published childs. Those that are not published are not even searched to be synchronized via Ajax
      Overrides:
      getPublishedChildrenList in class Component
      Returns:
      The List of published childs
    • buildDisplayScript

      public void buildDisplayScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is displayed.
      Overrides:
      buildDisplayScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Description copied from class: Component
      Every component can add a script to the StringBuilder, script executed when the component is created.
      Overrides:
      buildSetupScript in class Component
      Parameters:
      sb - The StringBuilder on which we want to add the script
    • setVISIBLE

      public void setVISIBLE(String s)
      Description copied from interface: Hideable
      Sets the visibility of the component
      Specified by:
      setVISIBLE in interface Hideable
      Parameters:
      s - String used to defines the visibility of the component
    • getVISIBLE

      public boolean getVISIBLE()
      Specified by:
      getVISIBLE in interface Hideable
      Returns:
      Use Hideable.isVisible()
    • isVisible

      public boolean isVisible()
      Description copied from interface: Hideable
      Checks the visibility of the component
      Specified by:
      isVisible in interface Hideable
      Returns:
      true if the component is visible, false otherwise
    • hasVisibleComponents

      protected boolean hasVisibleComponents()
    • findArea

      protected overit.geocall.basic.ui.control.Layout.Area findArea(Component c)
    • 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: AjaxableComponent
      Defines the morphing of the element that occurs when there is an Ajax interaction
      Specified by:
      changed in interface AjaxableComponent
      Parameters:
      change - The Change object that defines the specific morphing type for the element
    • getDefaultChange

      public overit.geocall.ux.servlet.processor.Change getDefaultChange()
      Description copied from interface: AjaxableComponent
      Defines the default Change object for the element
      Specified by:
      getDefaultChange in interface AjaxableComponent
      Returns:
      The default Change object that defines the default morphing type of the element
    • isAllowedConfigurationState

      public static boolean isAllowedConfigurationState(String confState)
    • getAllResponsiveGridChildren

      public Set<Component> 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

      public void setConfiguredProperty(Map<String,Serializable> properties)
      Description copied from interface: overit.geocall.ux.configurability.UIConfigurable
      Apply the user's properties customization into the component.
      Specified by:
      setConfiguredProperty in interface overit.geocall.ux.configurability.UIConfigurable
      Overrides:
      setConfiguredProperty in class Control
      Parameters:
      properties - The map containing the configured properties to set
    • getConfigurableProperties

      public Collection<overit.geocall.ux.configurability.UIProperty> getConfigurableProperties()
      Description copied from interface: overit.geocall.ux.configurability.UIConfigurable
      Gets a set of UIProperty object that represents the configurable UI properties that the object can handle.
      Each UIProperty object, 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:
      getConfigurableProperties in interface overit.geocall.ux.configurability.UIConfigurable
      Overrides:
      getConfigurableProperties in class Control
      Returns:
      object that represents the configurable UI properties that the object can handle.