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
.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
button.6. On the next page specify PSLMST as The physical file that most closely resembles this business object.
The
detects the Visual and Programmatic Identifiers required.7. Click the
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
button.
10. On the next page select the Include Default Save Button and Logic and click the Generate Code button.
The next page,
, 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
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
tab.c. Right-click the WAM to open the associated pop-up menu and choose the
option.d. In the
dialog select the option to generate XSL for all webroutines.e. Click
to check the changes in.f. Wait until the compiles have finished.