This example uses the IBM® VisualAge® for Java™ Enterprise
Edition V2.0 Composition Editor, but other visual bean builders are similar.
This example creates an applet for a button that, when pressed, runs a command
on the iSeries™ server.
- Drag-and-drop a Button on the applet. (The Button can be found in the
bean builder on the left side of the Visual Composition tab in Figure 1.)
- Drop a CommandCall bean and an AS400 bean outside the applet. (The beans
can be found in the bean builder on the left side of the Visual Composition
tab in Figure 1.)
Figure 1: VisualAge Visual
Composition Editor window - gui.BeanExample
- Edit the bean properties. (To edit, select the bean and then right-click
to display a window, which has Properties as an option.)
- Change the label of the Button to Run command, as shown in Figure
2.
Figure 2: Changing the label
of the button to Run command
- Change the system name of the AS400 bean to TestSys
- Change the user ID of the AS400 bean to TestUser, as shown in
Figure 3.
Figure 3: Changing
the name of the user ID to TestUser
- Change the command of the CommandCall bean to SNDMSG MSG('Testing')
TOUSR('TESTUSER'), as shown in Figure 4.
Figure
4: Changing the command of the CommandCall bean
- Connect the AS400 bean to the CommandCall bean. The method you use to
do this varies between bean builders. For this example, do the following:
- Connect the button to the CommandCall bean.
When you are finished, the VisualAge Visual Composition Editor
window might look like Figure 7.
Figure
7: VisualAge Visual
Composition Editor window - Finished bean example