Using 3270 screens in an application
To build an application that provides a graphical front end to a 3270-based host application, you must add a separate 3270 Screen part for each of the host screens your user needs to interact with. Each 3270 Screen part uses the value of its keyString attribute (usually specified in the part's settings view) to detect when the host screen it represents has become active.
The 3270 Screen part's public interface provides features that help you do the following:
• Determine which 3270 Screen part is active (based upon which host screen is currently displayed)
• Identify the position and length of all input and output fields
• Read from and write to the screen
• Send control keystrokes such as Enter, PF, and PA keys
The following is a list of some of the basic features of the 3270 Screen part's public interface.
Actions
refreshFieldDefs
Causes the 3270 Screen part to identify the position and length of all input and output fields on the host screen.
The 3270 Screen part only responds to the refreshFieldDefs action if the currently displayed host screen is the one it is set up to interact with, indicated by a matching key string. Therefore, you can use a single event to trigger the refreshFieldDefs action simultaneously on all of the 3270 Screen parts in your application; only the one 3270 Screen part representing the currently displayed host screen will respond.
getData
Reads the contents of all input and output fields on the host screen and places the values in the inputFields and outputFields attributes. The 3270 Screen part only responds to this action if the key string matches what is on the currently displayed host screen.
putData
Writes to the host screen the values of the input fields contained in the inputFields attribute.
pressEnter
Sends an Enter keystroke to the host application.
Events
fieldDefsRefreshed
Indicates that the 3270 Screen part has read the position and length of the input and output fields on the host screen, in response to a refreshAll action.
Because the 3270 Screen part only performs the refreshFieldDefs action when the screen specified by its key string is displayed, you can use the fieldDefsRefreshed event to detect when a particular 3270 Screen has become active.
screenChanged
Indicates that the previously displayed host screen has been replaced by a new one. You can use the screenChanged event to determine when to perform some other action on the screen.
dataRefreshed
Indicates that the values of the fields on the host screen have been read into the inputFields and outputFields attributes. You can use this event to trigger further processing after completion of the getData action.
Attributes
inputFields
Represents all of the input fields of the host screen. The inputFields attribute contains subparts representing each of the individual input fields, which you can access by tearing off the inputFields attribute.
outputFields
Represents all of the output fields of the host screen. The outputFields attribute contains subparts representing each of the individual input fields, which you can access by tearing off the outputFields attribute.
Last modified date: 01/29/2015