Step 1 Create Your Real WAM Command Handler

Visual LANSA

Step 1. Create Your Real WAM Command Handler

In this step, you will create a real WAM command handler for the Details command.

1.  Start the Program Coding Assistant.

2.  Select the iii HR application, then the Details command handler.

3.  Select Web – using WAM components as the platform.

4.  Select Basic Command Handler as the type of code you want create.

5.  Click the Next>> button.

6.  On the next page specify PSLMST as The physical file that most closely resembles this business object.

     The Program Coding Assistant detects the Visual and Programmatic Identifiers required.

7.  Click the Next>> button.

8.  On the next page specify PSLMST in the field Add fields from this physical file in the section Fields that you want to appear at the top of your command handler.

9.  Click the Add All button.

10.  On the next page select the Include Default Save Button and Logic and click the Generate Code button.

     The next page, Generated Code, displays the source code for your command handler.

     You now need to create the component that will contain the code:

a.  Specify iiiWAM120 (where iii are your initials). Make the description of the component Details command handler.

b.  Click the Create button and wait until you see a message saying the component has been created in the development environment.

11.  Switch to the Visual LANSA editor. The iiiWAM120 WAM is open in the editor.

12.  Locate the #avFrameworkManager.uWAMEvent_1 handler and add a statement to save any changes made to the employee details. For example:

UPDATE FIELDS(#WAM_HEAD) IN_FILE(PSLMST) WITH_KEY(#EMPNO)
 

13.  Locate the uInitialize event routine. This routine is always called when the command handler is invoked. Notice that it uses #avListManager.GetCurrentInstance method to get the key value of the currently selected item.

14.  The uExecute event routine is only ever executed when the WAM is executed (that is, when a filter is started or a command handler is executed). When events occur inside an active WAM (for example a button click) uExecute is not signalled, just the registered uWAMEvent_N event.

15.  Save the WAM.

16.  Check in your changes to the server:

a. Compile your WAM locally.

b.  If it compiles ok, select it in the Repository tab.

c.  Right-click the WAM to open the associated pop-up menu and choose the Check in option.

d.  In the Check in Options dialog select the option to generate XSL for all webroutines.

e.  Click OK to check the changes in.

f.  Wait until the compiles have finished.