People Goal 3 - Part 7: Build the main detail screen - Button Visibility

Document created by Kedar on Jan 28, 2015Last modified by communitymanager on May 12, 2015
Version 10Show Document
  • View in full screen mode

 


You’ve added your email button next to the email field, but what if that field is empty? There wouldn’t be much point in clicking the button since the email couldn't be sent. In that case, let’s hide the button so that the user isn’t distracted by something they can't use.

 

You’ll use the “Hide object when” condition to cause the button to disappear when there is no email address in the field. You used this feature in the Learn phase to make a “Click here to sign” message disappear.

 

The “Hide object when” condition can be applied to any layout object in Browse and Find mode. When the condition evalues to “true”, the layout object is not displayed. 

 

In the case of your button, you’ll not only cause it to disappear when the email field is empty but also when the window is in Find mode, since in that case as well there is no email address for the button to use.

 

This is a good technique to remember: if a functional button doesn’t work properly in Find mode, you might as well make it disappear. This simplifies the interface and gives a visual cue that the user has changed modes.

 

Here’s how the result looks in the example solution:


  • In Browse mode, with the Work Email field populated and the Personal Email field empty:
    pasted-image-8.png
  • In Browse mode, with the Work Email field empty and the Personal Email field populated:
    pasted-image-9.png
  • In Find mode (note the magnifying glass icons in each field):
    pasted-image copy 4.png

 


Goal:


To hide the email button when the email field is empty or the window is in Find mode.

 


Steps:


  1. Select your email button.

  2. Use the Inspector > Data tab > Behavior area to set the Hide object when condition to this:
    IsEmpty( [your email field] ) or Get(WindowMode)=1


    The example solution has this expression:
    IsEmpty( Contacts::Work Email ) or Get(WindowMode)=1

    The first part of the expression tests whether your field is empty. The second part checks whether the window is in Find mode.

  3. Use the Inspector > Data tab > Behavior area to select the Apply in Find mode checkbox.

    Unless this checkbox is selected, your Hide object when condition will only be applied in Browse mode.

  4. Test the results in Browse mode by populating your email field (the button should appear) and clearing it (the button should disappear).

  5. Test the result by entering Find mode and seeing whether the button disappears.

  6. If you have more than one email button, repeat steps 1 to 5 for each one, making sure that you reference the appropriate email field in each case.



     

      

Attachments

    Outcomes