The following sections guide you through the construction of a simple VisualAge 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.
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:
Open the settings for the Password text entry field.
Select the 3270 HLLAPI category
and then select the 3270 screen part
Place the part anywhere on the free-form surface.
You will need to tailor the following instructions to the 3270 screen format used by your installation. VisualAge 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:
Select Build records. VisualAge scans the screen currently visible in your emulator window, in this case your 3270 logon screen. VisualAge 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 VisualAge 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.
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 VisualAge 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:
This will enable the push button whenever the 3270 logon screen is visible in the emulator window.
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:
This moves the data from the VisualAge window to the 3270 screen in the emulator.
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.