This page is is for application designers who need to create forms. It explains techniques for associating text with a data field, to label a field.
Overview
There are several ways that you can use stream data to set labels on a dashboard. You can:
- Set a Dynamic Text Field Value
- Set a label on a field
- Set Place Holder Text on a field.
See also
- Understanding Components and Layouts
- Showing Data on a Screen for information about binding data to a form.
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Link a Dynamic Text Field to an Attribute
Fields must always be added to a container component, usually a form. You can bind a form to a stream or view, which tells PhixFlow what data is available to child components in the container.
For dynamic text fields, PhixFlow matches the field to an attribute in the bound stream or view by matching their names. This is shown in the following illustration.
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
A dashboard has a form container that includes dynamic text field.The dynamic text field displays the attribute Name from the selected record in a grid. |
Label a Field
When designing a dashboard, you usually want fields to have a label that indicates the data being displayed. For example
To do this, drag an attribute onto a form container. PhixFlow adds a default labelled field to the form.
To create a field from an attribute:
Open the properties tab for a stream or view.
In the Attributes section, drag an attribute onto a form container on the dashboard
PhixFlow adds a labelled field to the form.
A labelled field is a composite component that includes:
- a static text field, which takes its name from the attribute
- a data field that displays data from the attribute.
For information about composite components, see Grouping Components.
The default component to use when you drag attributes onto a dashboard are set in the Application properties or in System Configuration.
Editing a Form Field Label
To change the default name of a form field:
Click on the form field, then click again to select the label.
In the properties window on the right, update the
Display Text
to the desired value.Save your changes.
Manually Creating Form Fields
In the Screen's toolbar click theOpen the your desired palette e.g. Theme 2.1
Open the Labelled Fields section e.g.
Drag a labelled field onto your screen. Note, select a field that matches the type of data the attribute will display.
Provide a name when prompted.
Optional Steps
If you need your field to be backed by data it will need to be associated to an attribute on a stream.
Click on the broken link Icon.
Follow the wizard prompts.
Setting Place Holder Text
Place holder text can be used to display a message to communicate information to the user. The value can be set manually or set to match the form field label.
- Select the Form Field on the dashboard.
- In the properties window on the right:
- Type a value in the Place Holder Text field to manually set a value.
- Tick Use Field Name as Place Holder to use the name of the field as the place holder text.
- Type a value in the Place Holder Text field to manually set a value.
Advanced Editing
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.
Additional Reading
Showing Data on a ScreenInsert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
Overview
PhixFlow has different components that you can use to add text to a screen.
- Static Text: for specific text that you want to show on a screen.
- Dynamic Text: for text that changes depending on screen activity.
- Labelled Fields: for displaying table attribute values with labels.
- Place Holder Text: for form field. It appears as low-light text that displays details about a data field or instructions for the user to follow.
Adding Static Text
Static text is useful for many purposes including headings, button labels and instructions that you want the screen to display. To add static text:
Open your Palette, drag a static text field component onto your screen.
Static text templates can typically be found in the Basic Layout and Text sections of a palette.
To edit the text, in the properties for the static text navigate to Basic Settings → Display Text.
- To open the properties for the item simply click on the item on the screen.
Enter the fixed text you want to appear.
Use the Style Settings section to format the text. For example, you can specify the colour, weight and size of the text.
Save your changes.
Adding Dynamic Text
Dynamic text is useful when the text needs to adapt to the content of the screen, for example to show the name of a selected company. To add dynamic text:
Open your Palette, drag a dynamic text field component onto your screen.
Dynamic text templates can typically be found in the Basic Layout and Text sections of a palette..
To have the dynamic text reflect the value held in a table backing your screen, such as the name of an employee, simply name the Dynamic Text field to be the same as the attribute you wish to display. It is also possible to do the same with context variables.
Where there is no underlying table or the attribute value is empty, we can specify the default text to be displayed. In the properties for the dynamic text navigate to Basic Settings → Default Value.
- To open the properties for the item simply click on the item on the screen.
Enter the text you want to appear.
Use the Style Settings section to format the text. For example, you can specify the colour, weight and size of the text.
Save your changes.
Adding Dynamic Text with Returns
Text that has carriage returns in the text, aka new lines of text, for example outputting a set of results to a dynamic text area where each record is on a new line, is achieved as follows.
- Add a Dynamic Text Field to your screen.
- Such as Palette → Serene Grey → Basic Layouts → Text - Dynamic.
- When creating the value that is to be written to the dynamic text, use "\n" to add carriage returns to your string value.
- For Example:
Code Block do( forEach($i,1..countElements($myArray), $message = $message + "\n" + getElement($myArray, $i) ) //Output the message $message )
- This outputs each value in $myArray on a new line.
- For Example:
- The Dynamic Text field requires an entry in the CSS Properties
- CSS Tag,
white-space
- Value,
pre-wrap
- CSS Tag,
Adding Labelled Fields
Labelled fields are used to display and enter data on a form. We recommend adding attributes directly to a screen as PhixFlow will automatically:
- chooses a component that matches the attribute's data type.
- names the components.
- binds the field to the attribute.
- Styles the form field.
Tip |
---|
All the fields on a form must display data from the same table or view. You can create a view that includes attributes from different tables, provided the tables are related: see Entity Relationship Diagrams. |
Starting with Data (recommended)
- In the screen or screen element, to add a form container, right-click and select
.Insert excerpt _form_new _form_new nopanel true - From a list of attributes, drag an attribute onto the form container.
- For the first attribute you add, PhixFlow asks you to confirm that you want to bind this form container to the table or view.
- PhixFlow recognises that you want to add fields to a form. It uses the default labelled field, which is set in the Application Properties properties or in System Configuration.
Starting with Components from the Palette
Open your palette and expand one of the Form Fields sections, such as Form Fields by Data Type.
Drag components onto a form container, these should match the type of data you wish to display for example Date or Number.
Enter a name so that PhixFlow can save the component to the repository. Labelled fields use the name entered as it's label.
- No date will display until the screen is backed by data.
To bind the screen to data
- Bind the form container to a table or view; see Showing Data on a Screen.
If the name of the labelled field matches the attribute name from the table or view backing the screen the data will be displayed. If the names do not match you can:
right click on a field
Select Change Backing Attribute.
Select the appropriate attribute.
Save your changes.
Setting Place Holder Text
It can be useful to display information in the field itself. For example, giving instructions to the user to "Add customer's request here". Placeholder text is only displayed when a field has no data to display.
Drag a form field from the palette onto a form.
- Name the field. PhixFlow opens the field properties.
In the Basic Settings section:
either edit the Place Holder Text property to enter the placeholder text you want to use
or tick Use Field Name as Place Holder. PhixFlow uses field's name as the placeholder text.
Click
.Insert excerpt _finish _finish nopanel true