Package net.pricefx.formulaengine.forms
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 Summary
Modifier and TypeMethodDescriptionaddChild(FormLayoutNode node) addChild(ContextParameter input) Attaches a built input directly to this layout, without wrapping it in a row, container or modal.createContainer(String name) Creates a newFormContainer, grouping its children with an optional heading and collapsible behavior.createModal(String name) Creates a newFormModal, displaying its children in a popup dialog with an optional heading.Creates a newFormRow, arranging its children horizontally.
-
Method Details
-
addChild
- 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 acreate...Entry(...).buildFormInput()call- Returns:
input, so that calls can be chained- Since:
- 17.0 - Paloma
-
createRow
Creates a newFormRow, arranging its children horizontally. The row is not part of the layout until attached withaddChild(FormLayoutNode).- Parameters:
name- the row's unique name within the layout- Returns:
- the new row
- Since:
- 17.0 - Paloma
-
createContainer
Creates a newFormContainer, grouping its children with an optional heading and collapsible behavior. The container is not part of the layout until attached withaddChild(FormLayoutNode).- Parameters:
name- the container's unique name within the layout- Returns:
- the new container
- Since:
- 17.0 - Paloma
-
createModal
Creates a newFormModal, displaying its children in a popup dialog with an optional heading. The modal is not part of the layout until attached withaddChild(FormLayoutNode).- Parameters:
name- the modal's unique name within the layout- Returns:
- the new modal
- Since:
- 17.0 - Paloma
-