Page History
WAM080 - Session Management
1. Create a new WAM:
Name: iiiSessionMng
Description: Session Management 1
Layout Weblet: iiilay01
Again, note the Identifier assigned to this WAM. You will need this information in a later step. Of course you could always look up the Identifier in the Repository.
2. Press F7 to display the WAM properties. To enable session management, set SessionStatus to Active.
3. Define the following lists and global web maps:
* list of employees to be saved on the server Def_List Name(#empsave) Fields(#empno #surname #givename) Counter(#std_count) Type(*Working) Entrys(99) * latest search list of employees Def_List Name(#empnew) Fields((#empno *out) (#surname *out) (#givename *out)) Type(*Working) Entrys(99) * display current saved list of employees. Def_List Name(#empdisp) Fields(#stdselect (#empno *out) (#surname *out) (#givename *out)) Type(*Working) Entrys(99) * Map persistent data Web_Map For(*none) Fields(#empsave) Options(*PERSIST) * Map common return field from weblets Web_Map For(*input) Fields((#stdrentry *hidden))
Note that working list EMPSAVE is mapped as persistent data.
4. Create three WebRoutines based on the following:
* Initialize WebRoutine sets sessionstatus active WebRoutine Name(init) Onentry(*SESSIONSTATUS_NONE) #com_owner.sessionstatus := active Message Msgtxt('Session is now active') Transfer Toroutine(search) Endroutine * Perform search and display results. WebRoutine Name(search) Desc('Build a list of employees') Web_Map For(*both) Fields(#surname) Web_Map For(*output) Fields(#empnew) Endroutine * Load and display a list, from the saved list WebRoutine Name(showsave) Desc('Show saved list of employees') Web_Map For(*output) Fields(#empdisp) Endroutine
Note that as outlined in the Objectives, the init WebRoutine may be executed before a session is active.
5. Add the initial logic to WebRoutine search.
...
|
Adjust the width of the push button to show the caption as a single line.
Save your changes.
Your page should look like the following:
11. Open the showsave WebRoutine in the Design view. Select the list, move the cursor right and press enter to create a blank line below the list. Drop a push button below the list and set up its properties:
...
|
Your web page should look like the following:
12. Save your changes.
13. Execute your WAM in the browser by running any WebRoutine. Control will pass to the init WebRoutine which will enable session management, and transfer to the search WebRoutine.
You should be able to see the following results:
...


