Step 2 Create Employee Number AutoComplete WAM

LANSA WAM

Step 2. Create Employee Number AutoComplete WAM

WAM085 - Enhancing the User Interface

This step illustrates how you can create a small response WAM to service any web page that uses an AutoComplete weblet for field employee number (EMPNO).

1.  Create a new WAM:

     Name: iiiEmpAutoCmpl

     Description: Employee Number AutoComplete

     Layout Weblet: iiilay01

2.  Copy the following WebRoutine from WAM iiiEmpSearch.

WebRoutine Name(Empno_Prompt) Response(*JSON)
Web_Map For(*input) Fields(#empno)
Web_Map For(*output) Fields((#emp_dd *json))
Def_List Name(#emp_dd) Fields(#empno #std_code) Counter(#std_count) Type(*Working)
Clr_List Named(#emp_dd)
Select Fields(#emp_dd) From_File(pslmst) Where(#std_count <= 3) With_Key(#empno) Options(*startkey *endwhere)
#std_code := #empno
Add_Entry To_List(#emp_dd)
Endselect
Endroutine

 

3.  Compile the new WAM.