...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Widget Connector | ||||||
---|---|---|---|---|---|---|
|
Update the buttons in your app with conditional formatting to give them a more natural flow. To recap the steps in the video:
Add a Clear button
- Add a new button to the
Businesses
dashboard- Right click on the
Business tab
and go to Open Palette → Basic Components - Hold Shift and drag a new button on to the
SimpleButtonHolder
area
- Right click on the
- Configure the new button:
- Name:
ClearBusinessFields
- Action Type: Clear All Fields
- Order:
4
- Button Label:
New
- Name:
Go into App Mode and try the new button. You will see that it clears the values from all fields on the form. This is a useful button to press before entering details for a new entry.
Using Conditional Formatting
Now we will hide the buttons the users do not need to see when they are entering data. We will hide the Delete
and Update
buttons when the details on the screen are blank. To do this, we can test the value of UID
. Remember that the UID
field is configured on the edit screen, and hidden - but this means we can use the value of UID
. We know that UID
is always set for every record, so we can test whether this is null or not to work out whether the fields on the edit form are currently populated. Remember that to access a value on the edit form in an expression we can use _form.
- To conditionally hide the
Delete
button:- Click on the
Delete
button to open the configuration form - Go to the section Formatting Rules
- Add a formatting rule
- Set the Rule Expression to
_form.UID
== _NULL
- Since there is currently no hidden style, we will add one:
- Next to Style, press +
- Set Name to
Hidden
- Tick the Hidden flag
- Save the style
- In the formatting rule, set the Style to
Hidden
- Save the formatting rule
- Click on the
- Apply the same settings to the
Update
button - Apply the same settings to the
New
button - Now update the
Add
button so that it is not shown when the user is updating a record, that is, when theUID
field is set:- Open the configuration form for the
Add
button - Add a Formatting Rule
- Set the Rule Expression to
_form.UID ! ==
_NULL
- set the Style to
Hidden
- Save the formatting rule
- Open the configuration form for the
Go into App Mode, and check that when you press New
, all fields are cleared, and the Update, Delete
and New
buttons disappear, but the Add
button is shown. Also check that when you select a record, the Add
button is not displayed.
Panel |
---|
Next video: 8. Styling Grids |