Screen Wrapper Fundamentals

RAMP-NL

Screen Wrapper Fundamentals


Define your screen wrapper

A screen wrapper is a VL reusable part of class VF_SY122. You must define it globally scoped as opposed to inside any type of routine.

Define_Com Class(#vf_sy122) Name(#myscreen_wrapper) Parent(#PANL_1) Visible(False)

Key Points:

·         Set the initial visibility to False. This will ensure it will never show up unless you want to. For example you might want to make it visible in design mode when a fatal error occurs to give you the option of seeing what the current 5250 screen is.

·         You might want to make it a child of a panel attached to the center of the main panel. This will make it easier to see when you want to make it visible to track down fatal errors.

Set the uCommand property

In the command's uInitialize method routine, set the screen wrapper's uCommand property:

Mthroutine Name(uInitialize) Options(*REDEFINE)

* Do any initialization defined in the ancestor

Invoke Method(#Com_Ancestor.uInitialize)

Set Com(#myscreen_wrapper) Ucommand(#com_owner)

Endroutine

Key Points:

·         Always set uCommand to #com_owner.

·         Failure to set uCommand will result in an error message of type VF_INIT_ERROR.

Kick off execution by making RAMP available for a specific action

Usually you will invoke MakeRampAvailable Method inside the uExecute method of your command for the first time:

#myscreen_wrapper.MakeRampAvailable Foraction(Display)

Key Points:

·         The first time you make RAMP available during the first execution of a command it will take slightly longer for the event to be fired because RAMP is not connected to the host.

·         The command regains control in the event routing handling RampAvailable Event.

Listen to the RampAvailable event

Once RAMP has connected and it's ready to be interacted with it will signal back to the command. It will pass the value of the action you requested. Typically this routine will consist of a CASE statement handling all the possible actions.

Listen to the RampMessage event

You write error handling logic and handle messages originating in your 5250 application in the RampMessage Event.