6.6 Building the Subfile Component

Before building this component you must first save it. You must also tell the GUI Designer which AS/400 server you want to connect to before you can use the database reference information.

Saving the COMPLIST Component

Follow these steps:

  1. Select Project > Save. The Save window appears.
  2. For the Application Name specify Customer List Component.
  3. Change the Source File and Source Directory to COMPLIST. Click OK to save the project.

Defining the AS/400 Server and Database File

Next you must tell the GUI Designer which AS/400 server you want to connect to before you can use the database reference information.

Follow these steps:

  1. Select Server from the menu bar.
  2. Select Define AS/400 information. The Define AS/400 Information notebook appears.
  3. Click Add. The Add Server Alias Name window appears.
  4. Enter your AS/400 Server alias name.
  5. Select the correct remote location name from the combination box. Make sure the TCP/IP radio button is selected.
  6. Click OK to leave the Add Server Alias Name window.
  7. Go to the Files page.
  8. Click Add to add a new file definition. The Add File Alias Name window appears.
  9. In the File alias Entry field, type the name of the file you specified on the file specification (CUSTOML1).
  10. In the Remote file Entry field, type the actual file name (ADTSLAB/CUSTOML1).
  11. From the Server Alias drop-down combination box, select the server alias name you defined in a previous step.
  12. Click OK to add this file definition.
  13. Click OK to save and close the notebook.

Building the CustList Component

Last, you can now build and test the component.

Follow these steps:

  1. Now build the project by selecting Project > Build > Windows NT/95/98. If you receive any errors, you will need to fix the errors before you can continue.
  2. Finally, test the component by selecting Project > Run and either Windows NT/95/98 or Java. The subfile displays with a list of all customers from the data base.
  3. Close the Subfile display.

Click on to indicate that you've done all the steps.

This completes exercise 6. You now have a finished Customer List component window for your application. Next you need to enhance your application to use this new window.

But before you do, we recommend you do the Quiz.