Versions Compared

Key

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

...

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.