List Form Component
Last updated
Last updated
The "List Form Component Container" component is a container that has 1 Form Component inside it. However, it displays in the application one instance of the contained form component for each record of the foundset. It has no additional UI decorations. The contained form component can optionally show related data.
It is suited for use in both Advanced (Responsive) and Simple CSS forms.
List Form Component Container is used most often in Advanced (Responsive) forms, as the space it takes on the screen depends on how many instances of the contained form component are shown. When used in Simple CSS forms and the space taken by the contained form component exceeds the allocated space on the main form, there will be a scroll inside the List Form Component Container.
Form Components are an advanced feature. Please first see other Form Container types to explore options for nesting forms within forms.
Here are the steps for placing a container on the form:
Open the Form Editor of the form where you need to place an List FormComponent Container
Find List FormComponent Container in Form Containers section in the components' pallet
Drag and drop the List FormComponent Container component in the desired place of the form, the Select Form Component
wizard will appear
Select the desired Form Component (it can be related or unrelated to the form's dataSource), then click OK
Edit the elements of the contained Form Component, when it's necessary
Edit other needed List FormComponent Container properties
It is recommended to set a specific name
in the List Form Component Container properties in order to make it easier to use it later in scripting.
Example: list_fc_customer_orders
.
Instances of the contained form component can de displayed in two ways:
List View : instances are displayed one under the other
This view can be obtaiend by selecting listview
in the List Form Component Container pageLayout property
Card view : instances are displayed as cards, on multiple columns and rows (when the case)
This view can be obtaiend by selecting cardview
in the List Form Component Container pageLayout property
Because a Form Component form doesn't have its own logic (.js file), events like onAction
of an element can be assigned only to scopes or entity methods.
Example:
You can add logic for a label created in a Form Component form (placed in a Liat Form Component Container) by accessing that label in the main form and assign the label events to the main form's scope (.js file):
Elements of a contained Form Component can be accessed in the main form where its List Form Component Container is placed.
Example:
The user can define a custom style for the selected instance of the contained form component, using the List Form Component Container SelectionClass property.
In case rowStyleClassDataprovider
or rowStyleClass
are used, make sure that the selection styleclass definition is last in the solution stylesheet, to avoid overwriting it.
This property adds a adds a styleclass to the row. It is usually used in combination with a calculation to parse a piece of text that is used as the styleclass.
Example:
Having a different background color according to an order delivery date. To achieve this there are a few steps to be followed:
create a calculation in orders
table:
make sure the the classes used in calculation exist, otherwise create them in a .less file:
access the list form component container in the main form and set the calculation name in RowStyleClassDataprovider
This is a dataprovider that will return true or false. In case it is true, that row is editable, otherwise it is not.
Example:
Having a read-only card/row according to an order shipped date:
in case there is not already a boolean table column of the foundset/datasource, then a calculation is needed:
orders_calculations
access the list form component container in the main form and set the calculation name in RowEditableDataprovider
-->