RAMP-TSAD03 Step 1. Understand What Makes the Prompter Appear
As you learnt in RAMP-TS010: Using Special Field Handlers, automated prompting is set up in a table associated with a RAMP-TS session.
1. Open RAMP Tools and click on the Session node in the Screen and Script List on the left.
2. Locate the Special Field Handling table in the session details. You have defined in the table that if a field named utxtDepartment is on any 5250 screen, and the user presses F2, the special field handler DF_PRM04 is invoked.
DF_PRM04 is a Visual LANSA component. It is present, with source code, in your VL environment.
In this case the function key you have chosen, F2, is not allowed by the 5250 screen. When the user presses the key, the request is intercepted and handled entirely on the client PC.
However, even if you use a key/button that is allowed by the 5250 screen, and you associate a special handler for the field with this key, the request will be intercepted and handled on the client PC. To understand why this is so:
3. Open the script associated with the DisplayEmployee screen.
4. Locate the vHandle_BUTTONCLICK function:
The HANDLE_PROMPT() function call invokes a RAMP supplied function.
Using the name of the focus field on the 5250 screen and the function key used, it works out whether it should call a special field handler:
- If it does, HANDLE_PROMPT() returns true – it handled the request – which is why the button script immediately terminates via return operation.
- If HANDLE_PROMPT() did not invoke a special field handler it returns false, the button script continues to process the button click using its own logic.
In most cases the prompt request will be sent on to the 5250 screen for handling by the server because there will be no special field handler.
5. To test this out, disable the F2 key and enable the F4 key in the DisplayEmployee screen.
6. Save your changes and restart the Framework.
7. Locate the Employees business object in the Personnel application and display the details of an employee.
8. Press F4 on the Department Code field. Notice that the 5250 prompter is displayed.
9. Start the RAMP Tools and change the special field handling for the utxtDepartment field to use F4.
10. Save the RAMP definition and restart the Framework.
11. Display the details of an employee in the Personnel application and press F4. The special field handler is displayed.