Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Widget Connector
width900
urlhttps://www.youtube.com/watch?v=EgTeYHlb6D0&list=PLbPt6SI1Zhb8CnWh7Gvopto7D6LEwcB9A&index=9
height500

Update the buttons in your app application with conditional formatting to give them a more natural flow. To recap the steps in the video:

Add a Clear

...

Button

  1. Add a new button to the Businesses dashboard.
    1. Right-click on the Business tab and go to Open Palette → Basic Components.
    2. Hold Shift and drag a new button on to onto the SimpleButtonHolder area.
  2. Configure In the new button, set:
    1. Name: ClearBusinessFields
    2. Action Type: Clear All Fields
    3. Order: 4
    4. Button Label: New

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 click before entering details for a new entry.

Using Conditional Formatting

Now we will hide the buttons the that users do not need to see when they are entering data.

We will can 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 is 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.

  1. To conditionally hide the Delete button:
    1. Click on the Delete button to open the configuration form.
    2. Go to the section Formatting Rules.
    3. Add a formatting rule.
    4. Set the Rule Expression to _form.UID == _NULL
    5. Since there is currently no hidden style, we will add one:.
      • Next to Style, press click +Set Name to  and set:
        • Name: Hidden
        Tick the 
        • Hidden flag: tick
      • Save the style.
    6. In the formatting rule, set the Style to Hidden.
    7. Save the formatting rule.
  2. Apply the same settings to the Update button.
  3. Apply the same settings to the New button.
  4. Now update the Add button so that it is not shown when the user is updating a record, that is, when the UID field is set:.
    1. Open the configuration form for the Add button.
    2. Add a Formatting Rule and set:
        Set the 
        • Rule Expression
         to 
        • _form.UID ! =
        =
        •  _NULL
        set the 
        • Style
         to 
        • Hidden
      • Save the formatting rule.

Go into App Mode. Click New, and check that when you press New, :

  • all fields are cleared

...

  • the Update, Delete and New buttons disappear

...

  • the Add button is shown.

Also check that when you select a record, the Add button is not displayed.

You can also apply this conditional formatting for buttons to the Contacts dashboard and your templates.



Panel

Next video: 8. Styling Grids

...