Interface FormContainer

All Superinterfaces:
FormLayoutNode

public interface FormContainer extends FormLayoutNode
A container layout node used to group form inputs with an optional heading and collapsible behaviour. Created with layout.createContainer(name) (see FormLayout.createContainer(String)) and populated with addChild(FormLayoutNode)/addChild(ContextParameter).

Example:


 def layout = form.layout()

 layout.addChild(
     layout.createContainer("main")
         .setHeading("Order Details")
         .setCollapsible(true)
         .addChild(input1)
 )
 
Since:
17.0 - Paloma
See Also:
  • Method Details

    • setCollapsible

      FormContainer setCollapsible(boolean collapsible)
      Sets whether the user can expand and collapse this container. Must be set to true for setCollapsed(boolean) to have any effect.
      Parameters:
      collapsible - true to allow expanding/collapsing
      Returns:
      this FormContainer, so that calls can be chained
      Since:
      17.0 - Paloma
    • setCollapsed

      FormContainer setCollapsed(boolean collapsed)
      Sets whether this container starts collapsed. Only takes effect if setCollapsible(boolean) has already been called with true; call setCollapsible(true) first.
      Parameters:
      collapsed - true to start collapsed
      Returns:
      this FormContainer, so that calls can be chained
      Since:
      17.0 - Paloma
    • setHeading

      FormContainer setHeading(String heading)
      Sets the heading displayed above this container's inputs.
      Parameters:
      heading - text shown as the container's heading
      Returns:
      this FormContainer, so that calls can be chained
      Since:
      17.0 - Paloma
      See Also:
    • addChild

      FormContainer addChild(FormLayoutNode child)
      Attaches child to this container.
      Specified by:
      addChild in interface FormLayoutNode
      Parameters:
      child - the layout node to attach
      Returns:
      this FormContainer, so that calls can be chained
      Since:
      17.0 - Paloma
    • addChild

      Attaches a built input directly to this container.
      Specified by:
      addChild in interface FormLayoutNode
      Parameters:
      child - the input to attach, typically built with a create...Entry(...).buildFormInput() call
      Returns:
      this FormContainer, so that calls can be chained
      Since:
      17.0 - Paloma