Interface FormLayout


public interface FormLayout
The root builder for a form's visual layout, obtained via form.layout() in the Init phase (see FormInitApi.layout()). Create FormRow, FormContainer and FormModal nodes with createRow(String), createContainer(String) and createModal(String), then attach them (and built inputs) to the layout tree with addChild(FormLayoutNode)/addChild(ContextParameter), starting from this root.

Example, a container holding a row of two inputs and a modal with a third:


 def layout = form.layout()

 layout.addChild(
     layout.createContainer("main")
         .setHeading("Order Details")
         .setCollapsible(true)
         .addChild(
             layout.createRow("row1")
                 .addChild(input1)
                 .addChild(input2)
         )
         .addChild(
             layout.createModal("detailsModal")
                 .setHeading("More Details")
                 .addChild(input3)
         )
 )
 
Since:
17.0 - Paloma
See Also:
  • Method Details

    • addChild

      Attaches node (a FormRow, FormContainer or FormModal) to this layout.
      Parameters:
      node - the layout node to attach
      Returns:
      node, so that calls can be chained
      Since:
      17.0 - Paloma
    • addChild

      Attaches a built input directly to this layout, without wrapping it in a row, container or modal.
      Parameters:
      input - the input to attach, typically built with a create...Entry(...).buildFormInput() call
      Returns:
      input, so that calls can be chained
      Since:
      17.0 - Paloma
    • createRow

      FormRow createRow(String name)
      Creates a new FormRow, arranging its children horizontally. The row is not part of the layout until attached with addChild(FormLayoutNode).
      Parameters:
      name - the row's unique name within the layout
      Returns:
      the new row
      Since:
      17.0 - Paloma
    • createContainer

      FormContainer createContainer(String name)
      Creates a new FormContainer, grouping its children with an optional heading and collapsible behavior. The container is not part of the layout until attached with addChild(FormLayoutNode).
      Parameters:
      name - the container's unique name within the layout
      Returns:
      the new container
      Since:
      17.0 - Paloma
    • createModal

      FormModal createModal(String name)
      Creates a new FormModal, displaying its children in a popup dialog with an optional heading. The modal is not part of the layout until attached with addChild(FormLayoutNode).
      Parameters:
      name - the modal's unique name within the layout
      Returns:
      the new modal
      Since:
      17.0 - Paloma