Layout Columns Sample Builder
This is a sample custom builder that takes a selected Page Automation element and divides it into the specified number of columns. It's designed for use on a single-record view, such as a details, create, or update page. Note that you can also create multiple columns on a page by using tools such as the Two-Column layout available on the Design view palette or the Form Layout builder. The key feature of this builder is that the builder dynamically creates the columns, even if the set of fields has changed since the builder was last opened in Designer. This is different than Display Manager, which stores specific field names in the builder, which means it doesn't update dynamically if you change the number of fields in the data, for example.
This builder is an example of a “Page Automation” builder, which implements the PageAutomationBuilder interface. The builder code adds Page Automation container elements for the columns, and moves the Leaf nodes into the column containers.
Screenshot of builder UI
Screenshot of running model, with 3 columns generated
There is one known issue with this builder that hasn't been addressed yet: If you try to use this builder on an input page that uses Rich Text Editor you will get a compile error.
There are just two files in the layout_columns_builder.zip package:
LayoutColumnsBuilder.bdef – The builder def file for the builder. There are just two builder inputs as shown above.
LayoutColumnsBuilder.java – The builder's Java code, which implements the PageAutomationBuilder interface.
There is an alternate implementation of the builder in the package called layout_columns_builder_v2.zip. This builder is similar in inputs and functionality, but it generates a layout where all the fields for each row are aligned horizontally. To achieve this, it applies a special HTML template to the page element.
Here is a screenshot of the second version of the builder, this time applied to an Update page.