Getting Started-JetNet


Lesson 14. 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 lessons 12 and 13).

  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 these widgets' Double Click property to ^send_dst_data("SELECT").

    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().

    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 (page 16-20).

  5. Save all open screens (press F6).

Write 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 FileSave.

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.

  1. 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 13.

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

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

  2. Enter (555) 345-6000 in the Phone field and choose Save.
  3. Close the Distributor Orders screen (choose Close from the system menu).

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

  4. 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: