Getting Started-2-Tier


Lesson 10. Customizing Screen Behavior

After an application's basic functionality is in place, you typically continue to work on it to fine tune its behavior and usability. This lesson shows how to:

  1. If necessary:

Add double-click functionality

A widget's Double Click property can be set to a control string that determines what happens when users double-click on that widget. In this lesson, you edit the client screen dstslect.scr to control what happens when a user double-clicks on a distributor record in the grid widget. The grid widget columns' Double-click property is set to call the send_dst_data procedure, which displays the selected distributor's record for editing. Thus, double-clicking on any grid widget field emulates the behavior of the Orders button (described in Lesson 8 and Lesson 9).

  1. Bring focus to the dstslect.scr client screen and in the grid widget, select widgets distrib_id, distrib_name, and phone by selecting grid columns Distrib_id, Distributors, and Phone columns:
  2. Under Validation, set the Double Click property to ^send_dst_data("SELECT") for these widgets.

    When the user double-clicks in any of the columns in the grid widget, the send_dst_data procedure executes (as it also does when the Orders push button is chosen) and sends the selected ID to the dstord.scr client screen.

  3. Bring focus to the dstord.scr client screen and select all the columns in the grid widget.
  4. Under Validation, set the Double Click property to ^send_order_data() for these columns.

    When the user double-clicks on a specific order, the send_order_data procedure, which is associated with the dstord.scr screen, is called. This procedure is described later.

  5. Save all open screens (press F6).

Add a screen entry function that executes only on screen exposure

When you edit an existing distributor's data or add a distributor on the dstord.scr (Distributor Orders) screen, it is not immediately visible when you return to the dstslect.scr (Select Distributor) screen. You can enhance the screen entry procedure on the dstslect.scr client screen so that when the screen redisplays (after the Distributor Orders screen closes), a View command automatically executes. This causes the updated database records to redisplay.

  1. If necessary, reopen the JPL edit window for the dstslect.scr client screen:
  2. In the JPL edit window, delete the screen wizard screen entry procedure—everything up to the send_dst_data procedure.
  3. Get the new screen entry procedure from the tutorial library:
  4. Save the procedure: choose Apply.

Test the JPL

Now when you add or edit a distributor record, those changes should display immediately after you return to the Select Distributor screen.

  1. Bring focus to the dstslect.scr client screen.
  2. Choose FileTest Mode or

    The Select Distributor screen opens.

  3. Enter M in the Distributor field and choose

    All distributors having an uppercase M in their name are displayed, including the one you added in Lesson 9.

  4. Double-click anywhere on the Movie Time row.

    The Distributor Orders screen opens, overlaying the Select Distributor screen.

  5. Enter (555)345-6000 in the Phone field and choose Save.
  6. Close the Distributor Orders screen (choose Close from the system menu or press Escape).

    The Select Distributor screen regains focus. The phone number shows the new data that you just saved to the vidsales database.

  7. Return to the editor when you're done. Remember to save your screens (FileSave All).

What did you do?

You enhanced the user interface by performing these tasks:

What did you learn?

You learned: