Step 4. Create Form to display statuses and messages

INT001 - Getting Started with Basic JSM Operations

In this step, you will create the form needed to display the messages stored in the working list when executing JSM commands.

1.  Create a new Form/Basic Form named iiiFRM01 JSM Display, where iii is your unique 3 characters.

2.  Create a form which will call iiiFN01, passing the working list WL_MSGS and then display the results in a List View control.  The List View control should have the fields JSMSTS and JSMMSG dragged onto it. Your code should look something like the following:

Function Options(*DIRECT)

Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(863) Clientheight(301) Componentversion(2) Left(620) Top(190)

Define_Com Class(#PRIM_LTVW) Name(#ListView1) Columnbuttonheight(27) Componentversion(2) Displayposition(1) Fullrowselect(True) Keyboardpositioning(SortColumn) Left(56) Parent(#COM_OWNER) Showsortarrow(True) Tabposition(1) Top(47) Height(210) Width(753)

Define_Com Class(#PRIM_LVCL) Name(#LVCL1) Displayposition(1) Parent(#ListView1) Source(#JSMSTS)

Define_Com Class(#PRIM_LVCL) Name(#LVCL2) Displayposition(2) Parent(#ListView1) Source(#JSMMSG) Widthtype(Remainder)

 

Def_List Name(#WL_MSGS) Fields(#JSMSTS #JSMMSG) Type(*WORKING) ENTRYS(*max)

 

Evtroutine Handling(#com_owner.CreateInstance)

 

Set Com(#com_owner) Caption(*component_desc)

 

Call Process(*DIRECT) Function(iiiFN01) Pass_Lst(#WL_MSGS)

 

Selectlist Named(#WL_MSGS)

Add_Entry To_List(#ListView1)

Endselect

Endroutine

 

End_Com 

 

3.  Save and compile your iiiFRM01 form.