Previous Topic: Detail the Logic to Open the Secondary DialogsNext Topic: Update eGolfer


Review Secondary Dialog Design

Follow these steps:

  1. Review the design for the update golfer secondary dialog. When this dialog opens, we want all of the golfer information displayed, except for the password. Since we do not have a separate dialog for handling password changes, we want the golfer to re-enter and verify their password as part of any changes made.
    1. In the action diagram, select the event handler EVENT ACTION open update golfer db. Then, from the Menu Bar select Edit, then Add Statement, and then Set….
    2. From the options, select attribute view, from the list of entity views select export golfer, and from the list of attributes select password. Then select the operator TO expression, select the expression spaces, and then select the Add push button to add the statement to the event handler. We want to add another Set statement just like the last one, only we want to set the export confirmation golfer password to spaces. To accomplish this, we can copy the statement we created in step b and change the entity view.

      With the statement you just added still highlighted, press F8 on your keyboard, and with the cursor (which now resembles a hand), select the SET in the highlighted statement again. This will add the new statement directly below the highlighted statement.

    3. Double-click export golfer in the second statement. In the Change dialog, select attribute view, then select the entity view export confirmation golfer. Since there is only one attribute view in the export confirmation golfer entity view, and since that attribute is of a character domain, the Toolset selected it for us automatically. Select the Change push button to change the statement. Now, we can add the open dialog statement. Select the SET in the second Set statement. Now, from the Menu Bar select Edit, then Add GUI Statement, and then Open…. Select Dialog UPDATE EGOLFER DB, then select the OK push button.

      The completed event handler should like the following example:

      Review Secondary Dialog Design

    4. Save your model.
  2. Review the design for the remove golfer secondary dialog. When this dialog opens, we are just going to display the golfer's name and email address and ask for confirmation of the delete.
    1. In the action diagram, select the event handler EVENT ACTION open remove golfer db. Then, from the Menu Bar select Edit, then Add GUI Statement, and then Open….From the Window Selection list select Dialog REMOVE EGOLFER DB, and then select the OK push button to add the statement to the event handler.

      The completed event handler should look the following example:

      Review Secondary Dialog Design

    2. Save your model.
  3. Review the design for the add scoring record secondary dialog. When this dialog opens, it should be blank. Remember that if a golfer adds several scoring records during one session, the information from the previous scoring record will be redisplayed unless we explicitly prevent that from happening. In this case, we just want to move the local blank scoring record to the export scoring record prior to opening the secondary dialog.
    1. In the action diagram, select the event handler EVENT ACTION open add scoring record db. Then, from the Menu Bar select Edit, then Add Statement, and then Move….
    2. From the list of entity views, select local blank scoring record. The Toolset automatically selects the export scoring record. Select the Add push button to add the statement. Now add the GUI statement to open the add scoring record db.

      The completed event handler should look like the following example:

      Review Secondary Dialog Design

    3. Save your model.
  4. Review the design for the update scoring record secondary dialog. When this dialog opens, we want to see the details of a specific scoring record selected from the list of scoring records on the eGolfer Home page.

    The logic for this event handler is slightly more complicated than it is for the other event handlers. We need to use a GUI statement to locate the selected scoring record from the group view, then move it into a single entity view to display it to the golfer.

    All GUI statements that deal with group views require that the group views be explicitly indexed. We created our views by using the Match and Copy feature to copy the server views into our client procedure. The group views as they existed in the server procedure step were implicitly indexed. As such, they were copied into our client procedure step as implicitly indexed as well. We need to change the group view properties in our client procedure to make them explicitly indexed.

    1. From the Menu Bar, select View, then Expand All Views. In the IMPORTS, double-click Group View import group of scoring records.
    2. In the Detail Import Group View dialog, change the and is always drop-down list from Implicitly indexed to Explicitly indexed and select the OK push button.
    3. Repeats steps a and b for the EXPORTS: Group View export group of scoring records, making them Explicitly indexed.
    4. Now, from the Menu Bar, select View, then Contract All Views.
    5. Save your model.
    6. Now, we can add the GUI statement. In the action diagram, select the event handler EVENT ACTION open update scoring record db. From the Menu Bar select Edit, then Add GUI Statement, then and Get Row….From the list of row types, select HIGHLIGHTED IN, from the list of repeating group views select import group of scoring records, and from the list of expressions select 1. Then select the push button Complete, select the expression subscript, select the repeating group view import group of scoring records, select the push button Complete, and then select the Add push button to add the statement to the event handler.

      What this statement is essentially doing is sequentially scanning through all of the occurrences in the group view, starting from the first occurrence in the group view. When it finds a highlighted row, it sets the subscript or pointer of the group view to that row number. This will then allow us to move the highlighted occurrence of the import group view to the single entity view in the export view, which will then populate the secondary dialog fields when it opens.

    7. From the Menu Bar select Edit, then Add Statement, then Move…. In the list of entity views, select import group scoring record, in the list of entity views select export scoring record, and then select the Add push button to add the statement to the event handler. Now, add the GUI statement to open the update scoring record db.

      The completed event handler should look like the following example:

      Review Secondary Dialog Design

    8. Save your model.
  5. Review the design for the remove scoring record secondary dialog. The logic for this event handler is the same as the logic for the update scoring record secondary dialog. We want to get the row highlighted in the import group and move it to a single entity view in the export view, then open the secondary dialog.

    Save your model.

  6. The last event handler is associated with the logout push button on the eGolfer Home primary dialog. When golfers select this push button, we want to transfer them to the eGolf Services home page. If you will recall, we set up transfers between these two procedure steps. The exit state value that will initiate the transfer flow back is RETURN. Add an EXIT STATE IS return statement.

    The completed event handler should look like the following example:

    Review Secondary Dialog Design

  7. Save your model.
  8. Close the action diagram.