RAMP TSAD03 Step 7 Communicating with a Handler

RAMP-TS

RAMP-TSAD03 Step 7. Communicating with a Handler

There are two ways to communicate additional intent and information to a handler.

The first involves passing information on the HANDLE_PROMPT() request.

1.   Start RAMP Tools.

2.   In the script for the DisplayEmployee screen locate the button script's HANDLE_PROMPT() function call and add string parameters to the call like this:

 

         HANDLE_PROMPT("My Parm1","My Parm2","My Parm3")

 

 Your code will look like this:

 

3.   Commit the changes and do a partial save of the RAMP definition.

4.   In the Framework window, display the details of an employee to run the modified script for the screen.

5.   Prompt the Department Code field by pressing Enter to display the testing/debugging handler DF_PRM06. The result you see looks like this:

  

The arguments passed to the HANDLE_PROMPT() function are passed on to the handler with the symbolic names UARG1, UARG2, UARG3, etc. The Visual LANSA handler can retrieve these values by using method calls like this in its code:

 

Invoke Method(#Com_Owner.uGet5250Field) Name(UARG1) Value(#Std_Text)  /* Get UARG1 value into #STD_Text */  

 

 

This technique is fine when you know what handler you are talking to, or are talking to all handlers generically. This technique also means you probably need a convention for what UARG1, UARG2, etc are used for.

To communicate with a specific handler, use the next technique.   

 

The second communication involves attaching information to the handler via the SET_SPECIAL_FIELD_HANDLER() function.

This is done by using the three optional parameters at the end of the function call.

6.   Change the SET_SPECIAL_FIELD_HANDLER statement you created in the previous step to:

 

          SET_SPECIAL_FIELD_HANDLER("utxtDepartment",KeyEnter,"DF_PRM06", "Other 1","Other 2","Other3");

 

 

7.   Commit your changes and do a partial save, then select an employee to run the script for the screen again.

8.   Cause the VF_PRM06 handler to be invoked. You will see this:  

These three information blocks allow you to communicate with a precise handler. The Visual LANSA handler can retrieve these values as properties, like this example:

 

#Product := #Com_Owner.uHandlerInfo1
#Customer := #Com_Owner.uHandlerInfo2
#ZipCode = #Com_Owner.uHandlerInfo1.toNumber()