Step 8 A Client Visual Form optional

LANSA Integrator

Step 8. A Client Visual Form (optional)

INT009 – Department & Employee Client (Optional)

If a Windows form is required to serve as the client application, this can easily be written. It would also call the client RDMLX function iiiFN09 to handle the interaction with the server function iiiFN08.

1.  Create a new basic form - iiiFRM01 – Display Department Employees.

Copy the following code to replace the existing form code:

Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientheight(319) Clientwidth(492) Height(353) Left(337) Top(148)
Define_Com Class(#DEPTMENT.Visual) Name(#DEPTMENT) Displayposition(1) Height(19) Left(4) Parent(#COM_OWNER) Tabposition(1) Top(8) Usepicklist(False) Width(201)
Define_Com Class(#PRIM_LTVW) Name(#LTVW_1) Componentversion(2) Displayposition(2) Fullrowselect(True) Height(249) Keyboardpositioning(SortColumn) Left(0) Parent(#COM_OWNER) Showsortarrow(True) Tabposition(2) Top(40) Width(489)
Define_Com Class(#PRIM_LVCL) Name(#LVCL_1) Displayposition(1) Parent(#LTVW_1) Source(#FULLNAME) Width(33)
Define_Com Class(#PRIM_LVCL) Name(#LVCL_2) Displayposition(2) Parent(#LTVW_1) Source(#SKILDESC) Width(44) Widthtype(Remainder)
Define_Com Class(#PRIM_PHBN) Name(#PHBN_1) Caption('Refresh') Displayposition(3) Left(213) Parent(#COM_OWNER) Tabposition(3) Top(8)
Define_Com Class(#PRIM_STBR) Name(#STBR_1) Displayposition(4) Height(24) Left(0) Messageposition(1) Parent(#COM_OWNER) Tabposition(4) Tabstop(False) Top(295) Width(492)
Def_List Name(#WL_EMPSKL) Fields(#FULLNAME #SKILDESC) Type(*WORKING) Entrys(9999)
Evtroutine Handling(#com_owner.Initialize)
Set Com(#com_owner) Caption(*component_desc)
Endroutine

Evtroutine Handling(#PHBN_1.Click)
Clr_List Named(#wl_empskl)

Exchange Fields(#deptment)
Call Process(*direct) Function(iiiFN09) Pass_Lst(#WL_EMPSKL)
Clr_List Named(#ltvw_1)
Selectlist Named(#wl_empskl)
Add_Entry To_List(#ltvw_1)
Endselect
Endroutine
End_Com
 

2.  Change the CALL statement to call your function iiiFN09.

3.  Compile and run the form. You should either be using a local web server and JSM Server or have the file:   jsmcltdta.txt configured to point to the JSM Server on an IBM i.