Class GroupBase

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean, Component, Ordered, ScriptEventSupport, Container, Group, LifecycleElement, Helpable, org.springframework.core.Ordered
Direct Known Subclasses:
AccordionGroup, CollectionGroupBase, DialogGroup, LightTable, LinkGroup, PageGroupBase, SidebarNavigationGroup, TabGroup, TabNavigationGroup, TreeGroup

public class GroupBase extends ContainerBase implements Group
Container that holds a list of Field or other Group instances

Groups can exist at different levels of the View, providing conceptual groupings such as the page, section, and group. In addition, other group types can be created to add behavior like collection support

Group implementation has properties for defaulting the binding information (such as the parent object path and a binding prefix) for the fields it contains. During the phase these properties (if given) are set on the fields contained in the Group that implement DataBinding, unless they have already been set on the field.

Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • GroupBase

      public GroupBase()
      Default Constructor
  • Method Details

    • performInitialization

      public void performInitialization(Object model)
      The following initialization is performed:
      • Sorts the containers list of components
      • Initializes the instructional field if necessary
      • Initializes LayoutManager
      The following updates are done here:
      • Invoke performInitialize on component modifiers
      Initializes the component

      Where components can set defaults and setup other necessary state. The initialize method should only be called once per component lifecycle and is invoked within the initialize phase of the view lifecylce.

      Specified by:
      performInitialization in interface LifecycleElement
      Overrides:
      performInitialization in class ContainerBase
      Parameters:
      model - - object instance containing the view data
      See Also:
    • afterEvaluateExpression

      public void afterEvaluateExpression()
      No-op implementation. Override for custom behavior in subclasses. Invoked by the view lifecycle after expressions are evaluated at the apply model phase.

      In general, this method is preferred to LifecycleElement.performApplyModel(Object, LifecycleElement) for populating model data via code, since it is called before client-side state is synchronize.

      Specified by:
      afterEvaluateExpression in interface Component
      Overrides:
      afterEvaluateExpression in class ComponentBase
    • performFinalize

      public void performFinalize(Object model, LifecycleElement parent)
      Sets the section boolean to true if this group has a rendering header with text The following finalization is performed:
      • Sets the headerText of the header Group if it is blank
      • Set the messageText of the summary Message if it is blank
      • Finalizes LayoutManager
      The following finalization is done here:
      • progressiveRender and conditionalRefresh variables are processed if set
      • If any of the style properties were given, sets the style string on the style property
      • Set the skipInTabOrder flag for nested components
      The last phase before the view is rendered

      Here final preparations can be made based on the updated view state.

      Specified by:
      performFinalize in interface LifecycleElement
      Overrides:
      performFinalize in class ContainerBase
      Parameters:
      model - - top level object containing the data
      parent - - parent component
    • setupValidationScripts

      protected void setupValidationScripts(GroupBase.ACTION_VALIDATION_COMPONENTS... componentsToValidate)
      Helper method to set the validation action scripts for widgets (at the very least, quickfinders, and currently, at the most, inquiries also).
      Parameters:
      componentsToValidate - the list of components with actions to validate
    • buildInputFieldValidationActionScript

      protected String buildInputFieldValidationActionScript(List<InputField> allInputFields, List<String> excludedFields)
      Helper method to build action script for input fields with actions that depend on the validation of other input fields in the same group.
      Parameters:
      allInputFields - all other input fields that might have validation constraints
      excludedFields - fields that shouldn't be part of the validation script
      Returns:
      the validation action script
    • validateInputField

      protected boolean validateInputField(InputField inputField)
      Helper method to determine whether the given input field needs validated or not.
      Parameters:
      inputField - the field to check for validation
      Returns:
      whether validation should be done
    • setNestedComponentId

      protected void setNestedComponentId(Component component, String newId)
      Helper method for setting a new ID for the nested components
      Parameters:
      component - component to adjust ID for
      newId -
    • getSupportedComponents

      public Set<Class<? extends Component>> getSupportedComponents()
      Set of Component classes that may be placed into the container

      If an empty or null list is returned, it is assumed the container supports all components. The returned set will be used by dictionary validators and allows renders to make assumptions about the contained components

      Specified by:
      getSupportedComponents in interface Container
      Returns:
      Set component classes
    • getComponentTypeName

      public String getComponentTypeName()
      The name for the component type

      This is used within the rendering layer to pass the component instance into the template. The component instance is exported under the name given by this method.

      Specified by:
      getComponentTypeName in interface Component
      Returns:
      String type name
    • getFieldBindByNamePrefix

      public String getFieldBindByNamePrefix()
      Binding prefix string to set on each of the groups DataField instances

      As opposed to setting the bindingPrefix on each attribute field instance, it can be set here for the group. During initialize the string will then be set on each attribute field instance if the bindingPrefix is blank and not a form field

      Specified by:
      getFieldBindByNamePrefix in interface Group
      Returns:
      String binding prefix to set
    • setFieldBindByNamePrefix

      public void setFieldBindByNamePrefix(String fieldBindByNamePrefix)
      Setter for the field binding prefix
      Specified by:
      setFieldBindByNamePrefix in interface Group
      Parameters:
      fieldBindByNamePrefix -
    • getFieldBindingObjectPath

      public String getFieldBindingObjectPath()
      Object binding path to set on each of the group's InputField instances

      When the attributes of the group belong to a object whose path is different from the default then this property can be given to set each of the attributes instead of setting the model path on each one. The object path can be overridden at the attribute level. The object path is set to the fieldBindingObjectPath during the initialize phase.

      Specified by:
      getFieldBindingObjectPath in interface Group
      Returns:
      String model path to set
      See Also:
    • setFieldBindingObjectPath

      public void setFieldBindingObjectPath(String fieldBindingObjectPath)
      Setter for the field object binding path
      Specified by:
      setFieldBindingObjectPath in interface Group
      Parameters:
      fieldBindingObjectPath -
    • getDisclosure

      public Disclosure getDisclosure()
      Disclosure widget that provides collapse/expand functionality for the group
      Specified by:
      getDisclosure in interface Group
      Returns:
      Disclosure instance
    • setDisclosure

      public void setDisclosure(Disclosure disclosure)
      Setter for the group's disclosure instance
      Specified by:
      setDisclosure in interface Group
      Parameters:
      disclosure -
    • getScrollpane

      public Scrollpane getScrollpane()
      Scrollpane widget that provides scrolling functionality for the group
      Specified by:
      getScrollpane in interface Group
      Returns:
      Scrollpane instance
    • setScrollpane

      public void setScrollpane(Scrollpane scrollpane)
      Setter for the group's scrollpane instance
      Specified by:
      setScrollpane in interface Group
      Parameters:
      scrollpane -
    • getItems

      public List<? extends Component> getItems()
      List of Component instances that are held by the container

      Contained components are rendered within the section template by calling the associated LayoutManager.

      Specified by:
      getItems in interface Container
      Specified by:
      getItems in class ContainerBase
      Returns:
      List component instances
    • setItems

      public void setItems(List<? extends Component> items)
      Setter for the containers list of components
      Specified by:
      setItems in interface Container
      Specified by:
      setItems in class ContainerBase
      Parameters:
      items -
    • getWrapperTag

      public String getWrapperTag()
      Defines the html tag that will wrap this group, if left blank, this will automatically be set by the framework to the appropriate tag (in most cases section or div)
      Specified by:
      getWrapperTag in interface Group
      Returns:
      the html tag used to wrap this group
    • setWrapperTag

      public void setWrapperTag(String wrapperTag)
      Specified by:
      setWrapperTag in interface Group
      See Also:
    • isAjaxDisclosureGroup

      protected boolean isAjaxDisclosureGroup()
      Returns true if this group has a Disclosure widget that is currently closed and using ajax disclosure
      Returns:
      true if this group has a Disclosure widget that is currently closed and using ajax disclosure
    • completeValidation

      public void completeValidation(ValidationTrace tracer)
      Validates different requirements of component compiling a series of reports detailing information on errors found in the component. Used by the RiceDictionaryValidator.
      Specified by:
      completeValidation in interface Component
      Overrides:
      completeValidation in class ContainerBase
      Parameters:
      tracer - Record of component's location
    • isRenderLoading

      public boolean isRenderLoading()
      Determine the group should be rendered on initial load, or if a loading message should be rendered instead.
      Specified by:
      isRenderLoading in interface Group
      Returns:
      True if a loading message should be rendered, false if the group should be rendered now.