Versions Compared

Key

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

WAM060 - Employee Maintenance using Advanced Weblets
At present the Details WebRoutine has no control over whether the Details or Skills tab is redisplayed. This can easily be achieved by introducing a field that is mapped to set the the tab_index property. 1.  Define

  1. Define a one character field TABINDEX.

...

  1.      Define Field(#tabindex)

...

  1.  Type(*char)

...

  1.  Length(1)

...


  1. In the Details WebRoutine extend the web_map for EMPNO to include TABINDEX as a hidden field.
        Web_

...

  1. Map For(*both)

...

  1.  Fields((

...

  1. #empno *hidden)

...

  1.  (

...

  1. #tabindex *hidden))

...


  1. In the CASE loop, set the TABINDEX in each When clause, as follows:

    When = D

    #Tabindex := '1'

    When = U

    #Tabindex := '1'

    When = N

    #Tabindex := '2'

    When = S

    #Tabindex := '2'

...



  1. Recompile your WAM.

...


  1. Open the Details WebRoutine in the Design view. Select the Tab Pages weblet and set the selected_tab_index_field to TABINDEX. (Select from the dropdown).

...


  1. Ensure the Details tab page is selected and Save your changes.

...


  1. Re-test your WAM. When working with the Skills tab, the Skills tab should now be redisplayed after the New Skill or the Save push button has been used.

Note

Note: This is a limited implementation, using simply the tab_index_field property. Using a hidden Nav Panel on each tab page, it is possible to return current tab index to a WebRoutine. This allows a design which supports selecting a different employee and always displaying the last tab page used (Details or Skills).