Example program using a 3270 screen part
The following sections guide you through the construction of a simple VA Smalltalk application that provides a graphical front end to a host logon screen. This application assumes a simple VM logon screen with two input fields to receive the user ID and password. In a real application, you would probably want to add additional function and error checking.
Building the window
Start by creating a new visual part named LogonView. In the Composition Editor, construct the visual part using two text entry fields, two labels, and two push buttons so that is looks similar to this:
Open the settings for the OK push button and do the following:
• Make the OK push button the default by setting the value of the showAsDefault attribute to true.
• Disable the OK push button by setting the value of the enabled attribute to false.
• Select the OK push button to save the push button part settings.
Open the settings for the Password text entry field.
• Enable password protection of the text typed into the field by setting the passwordProtect attribute to true.
• By default, the asterisk character (*) is used as the password protect character when typeing into a field enabled for password protection. To alter the character used simply change the passwordProtectCharacter attribute for the entry text part.
• Select the OK push button to save the text entry part settings.
Select the 3270 HLLAPI category
and then select the 3270 screen part
Place the part anywhere on the free-form surface.
Tailoring the 3270 Screen part
You will need to tailor the following instructions to the 3270 screen format used by your installation. VA Smalltalk makes it easy to handle formatted screens by scanning their format for you. To see this in action, ensure that your 3270 emulator window is running and your logon screen is visible before proceeding.
Open the settings view for the 3270 Screen part you just added. To identify the 3270 session and screen do the following on the General settings page:
• Set the Terminal id to A.
• Set the Settle time to 1.
• Set the Key sequence validation string to USER ID ===>. This identifies the 3270 session and screen.
Select Build records. VA Smalltalk scans the screen currently visible in your emulator window, in this case your 3270 logon screen. VA Smalltalk then places a list of the available input and output fields in their respective pages in the settings notebook. You can select Input Fields or Output Fields to view what VA Smalltalk captured from your 3270 screen. Select OK to accept the changes to the settings notebook.
To access the screen that was just captured, select Tear-off Attribute Created by ActiveSystems 29-07-1996 Entity not defined inputFields from the 3270 screen's pop-up menu, and place it anywhere on the free-form surface.
Connecting the parts
To move information to and from the 3270 screen you must connect the input and output field attributes of the 3270 screen part to data in your VA Smalltalk window. For this application, connect the FieldNumber15 attribute to the user ID text entry field's object attribute, and then connect the FieldNumber17 attribute to the password text entry field's object attribute. Now, whatever the user types into these fields will automatically be sent to the host 3270 application whenever the screen is sent back to the host.
Note:
Be sure to use the FieldNumber attributes that are appropriate for your installation.
The OK button is disabled whenever the user opens the window. It is desirable to provide visual feedback to the user by having the OK button enabled only when the 3270 emulator logon screen is visible. You provide this feedback by making the following connections:
1. Connect the 3270 screen's screenAppears event to the enable action of the OK push button.
This will enable the push button whenever the 3270 logon screen is visible in the emulator window.
2. Connect the 3270 screen's dataSent event to the disable action of the OK push button.
This will disable the push button whenever the 3270 logon screen is not visible in the emulator window.
To send the data to the host, do the following:
3. Connect the OK button's clicked event to the 3270 screen's putData action.
This moves the data from the VA Smalltalk window to the 3270 screen in the emulator.
4. Connect the OK button's clicked event to the 3270 screen's pressEnter action.
This sends the data in the 3270 screen to the host.
To close the window, connect the Close button's clicked event to the closeWidget action of the window part.
Your connections should now look like this:
Save your work and test it. The OK push button should be enabled, and you should be able to logon successfully, only when the logon screen is visible in the emulator window. The password field should show an * for each character in the password.
Last modified date: 02/27/2018