Class SectionItem

All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasCanEditChangedHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasEditorEnterHandlers, HasEditorExitHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasPendingStatusChangedHandlers, HasPickerIconClickHandlers, HasReadOnlyDisplayChangedHandlers, HasShowContextMenuHandlers, HasShowValueHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers, HasValueHoverHandlers, HasValueIconClickHandlers

public class SectionItem extends CanvasItem
Header item for a collapsible section in a DynamicForm. Each SectionItem is associated with a number of other items in the form, which will be shown or hidden as a group when the section is expanded or collapsed. Clicking on a SectionItem will expand or collapse the section.

To make a form where only one section is expanded at a time, set DynamicForm.sectionVisibilityMode to "mutex".

See Also:
  • Constructor Details

    • SectionItem

      public SectionItem()
    • SectionItem

      public SectionItem(JavaScriptObject jsObj)
    • SectionItem

      public SectionItem(String name)
    • SectionItem

      public SectionItem(String name, String title)
  • Method Details

    • getOrCreateRef

      public static SectionItem getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changePickerIconDefaults

      public static void changePickerIconDefaults(FormItemIcon defaults)
    • setCanCollapse

      public SectionItem setCanCollapse(Boolean canCollapse)
      Whether this section header can be collapsed. If set false, suppresses open/close state icon
      Parameters:
      canCollapse - New canCollapse value. Default value is true
      Returns:
      SectionItem instance, for chaining setter calls
    • getCanCollapse

      public Boolean getCanCollapse()
      Whether this section header can be collapsed. If set false, suppresses open/close state icon
      Returns:
      Current canCollapse value. Default value is true
    • setCanTabToHeader

      public SectionItem setCanTabToHeader(Boolean canTabToHeader)
      If true, the header for this Section will be included in the page's tab order for accessibility. May also be set at the DynamicForm level via DynamicForm.canTabToSectionHeaders.

      See Accessibility.

      Parameters:
      canTabToHeader - New canTabToHeader value. Default value is null
      Returns:
      SectionItem instance, for chaining setter calls
    • getCanTabToHeader

      public Boolean getCanTabToHeader()
      If true, the header for this Section will be included in the page's tab order for accessibility. May also be set at the DynamicForm level via DynamicForm.canTabToSectionHeaders.

      See Accessibility.

      Returns:
      Current canTabToHeader value. Default value is null
    • setEditProxyConstructor

      public SectionItem setEditProxyConstructor(String editProxyConstructor)
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class FormItem
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "SectionItemEditProxy"
      Returns:
      SectionItem instance, for chaining setter calls
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      getEditProxyConstructor in class FormItem
      Returns:
      Current editProxyConstructor value. Default value is "SectionItemEditProxy"
      See Also:
    • setItemIds

      public SectionItem setItemIds(String... itemIds)
      Names of the items that should be considered a member of this section.
      Parameters:
      itemIds - New itemIds value. Default value is null
      Returns:
      SectionItem instance, for chaining setter calls
      See Also:
    • setSectionExpanded

      public SectionItem setSectionExpanded(Boolean sectionExpanded)
      Whether this form section should be initially collapsed. Can be set programmatically via expandSection() and collapseSection().
      Parameters:
      sectionExpanded - New sectionExpanded value. Default value is true
      Returns:
      SectionItem instance, for chaining setter calls
      See Also:
    • getSectionExpanded

      public Boolean getSectionExpanded()
      Whether this form section should be initially collapsed. Can be set programmatically via expandSection() and collapseSection().
      Returns:
      Current sectionExpanded value. Default value is true
      See Also:
    • setSectionHeaderClass

      public SectionItem setSectionHeaderClass(String sectionHeaderClass)
      Name of the Canvas subclass to use as a header that labels the section and allows showing and hiding. The default class be skinned, or trivial subclasses created to allow different appearances for SectionItems in different forms. Very advanced developers can use the following information to create custom header classes.

      Note : This is an advanced setting

      Parameters:
      sectionHeaderClass - New sectionHeaderClass value. Default value is "SectionHeader"
      Returns:
      SectionItem instance, for chaining setter calls
    • getSectionHeaderClass

      public String getSectionHeaderClass()
      Name of the Canvas subclass to use as a header that labels the section and allows showing and hiding. The default class be skinned, or trivial subclasses created to allow different appearances for SectionItems in different forms. Very advanced developers can use the following information to create custom header classes.
      Returns:
      Current sectionHeaderClass value. Default value is "SectionHeader"
    • collapseSection

      public void collapseSection()
      Collapse a sectionItem, and hide all the items within the section (not including the header).
    • expandSection

      public void expandSection()
      Expands a section, showing all the items contained within the section.
    • isExpanded

      public Boolean isExpanded()
      Returns a boolean indicating whether this SectionItem is expanded.
      Returns:
      true if the section is expanded false if not
    • setDefaultProperties

      public static void setDefaultProperties(SectionItem sectionItemProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      sectionItemProperties - properties that should be used as new defaults when instances of this class are created
      See Also: