Using The HTMLAPI Scripting Object
The recommended approach to dynamically altering the visual content of 5250 screens is as follows:
- Whenever possible create SHARED functions that implements generic content changes so that they can be reused from other RAMP-TS scripts. By doing this you are also somewhat minimizing the impact that any future changes to the HTML or aXes DOM models might have on you.
- When content changes apply to a specific 5250 screen only, implement them in a single function inside the screens scripting object with a well defined name. By doing this the logic that alters a specific screens layout becomes somewhat standardized, easy to recognize and consolidated in one place
For example:
Example Function Name | What it might do? |
SHARED.ApplyStandardLayout()
|
Apply generic application layout rules to any destination screen. Most destination screens would invoke this function in their arrival script, just before making the screen visible. |
SHARED.AttachPromptImages()
|
Accepts an array of screen field names. It creates a small clickable image beside each named field. 5250 screens that display promotable fields would use this function generically. |
thisScreen.ApplySpecificLayout() |
Defined as a function within the definition of a specific 5250 destination screen. Applies layout changes that are specific to this screen. |