Labelling Fields
When designing forms you often want the field to have a text label, either above or beside the field, for example:
This type of layouts is made up of at least 3 components:
- a form component, with the settings:
- Basic Settings → Composite ticked
- Advanced → View Type → field container
- the child components
- a static or dynamic text field
- a data field, such as string, number or date.
To create a labelled field you can start from data or by setting up the fields.
Starting from Data
To create labelled fields, from any attribute list, drag attributes onto a form area to create labelled fields. PhixFlow uses the default palette's labelled field that is appropriate for the data type. Different palettes have different formatting and flow settings for labelled fields. Fields can also inherit properties, such as flow direction, from their container; see Using Size and Position for Responsive Design.
To find stream (table) attributes Data is stored in streams (tables). You can also create a data view based on a stream (table). Using a view means you can
- include attributes from related tables
- apply filtering and sorting to how data records are displayed without affecting the original stream (table).
You can bind
a stream (table) or view directly to an area, form-area or card-container->area. This is useful if the area contains multipleeans you can right-click the container and select Show attributes for the backing stream (table). This opens the list of available attributes that you can bind to specific components.
To create labelled fields starting with data:
- Open a list of stream (table) attributes. For example, in the repository:
- either expand Stream (table) → Attributes
- or open stream properties → Attributes section
Starting from the Field
PhixFlow has several different layouts of labelled fields in the palette.- Drag attributes onto an area or form-area on the screen canvas.
- PhixFlow adds a labelled field from your applications default palette.
This method has the advantage that the fields are automatically bound to the appropriate data.
Starting with a Layout
To create a labelled field layout, drag layouts from one of the palettes.
- Find the palette you want to use that contains labelled fields. For example:
- for basic formatting use palette → Labelled Fields
- for responsive design use palette → Theme 2 - App Builder Base Components
- for basic formatting use palette → Labelled Fields
- Drag a layout from the palette onto an area or form-area on the screen.
- Select field that matches the data type of the attribute
- that will be displayed.
- Bind the field to data: see Showing Data on a Screen.
Tip |
---|
Different palettes have different formatting and flow settings for labelled fields. Fields can also inherit properties, such as flow direction, from their container; see Using Size and Position for Responsive Design. |
Understanding Field Containers and
CompositesComposite Components
These are configured as composite components where the label and the field are associated todo - If you are ticking a box in a component's properties, how does it know
What this gives you
The two parts are effectively grouped. Selection selects them both, and if you move them they move together
When you add the name, it applies to both components and the name is used for the static text label
- Field container but not composite
- Composite but not field container....
Creating your own composite
- In a basic components palette, such as Basic Components, drag onto a form area
- an area to be a container
- the components you want to treat as a single layout
Right-click one of the new fields and select Find. In the layouts list, shift-drag to move the components into the container you created.
In the Advanced section, set the View Type to Field container.
In the Basic Settings section, tick Composite.
More text
In addition to a label, you may want additional text below the field. For example you might want to add
- static text, to explain what the user can do.
- dynamic text that depends on selected data.
- In a basic components palette, such as Basic Components, drag a Static Text or Dynamic Text layout onto a form area.
Right-click the new field and select Find. In the layouts list, find the container for the fields and double-click it to open its properties.
In the Advanced section, the View Type is Field container. Expand the drop-down list and select the empty row. Save the container component. This "opens" the container so you can add more components to it.
- In the layouts list, shift-click and drag the new component into the container. PhixFlow moves your component to be a child of the container component.
Important: Open the field container properties again and reset Advanced →View Type to Field container. All child components are now contained within the parent, which is also a composite component.
Example of the layout structure of a labelled field
todo Gif showing dragging on 2 attributes with basic formatting
todo 2 videos showing a basic attribut and one from a theme