Lesson 6: Add data to the page
In this exercise, you will add data from the database included with this tutorial onto the web page that you created in the previous exercise.
About this task
- You add fields to the Page Data view, associating those fields with the web page.
- You place fields from the Page Data view onto the related web page.
- You add a variable (in this case, an array of records) to an EGL
JSF handler, which you can think of as the code that stands behind
the runtime process. The JSF handler is an example of page code because
it can do any of these tasks:
- Assign data values for submission to the JSP file. Those values are ultimately displayed on the web page.
- Manipulate the data returned from the user or from a called program.
- Forward control to another JSP file.
In this lesson you will also use the EGL content assist feature, a tool that you can use to complete programming statements without having to type the entire statement.
Add a record array to the Page Data view and the JSF Handler
About this task
Procedure
Results
The Page Data view looks like this:

By adding entries to the Page Data view, you have also added an array of records to the JSF handler. In the next section, you will create the related fields on the web page.
Display the data on the web page
About this task
Procedure
Results

The columns in the data table have headings based on the names of the fields in the database. You can change these headings by clicking them, opening the Properties view, and changing the Value field.
The
three text fields in the data table, which appear as {CUSTOMERID}, {FIRSTNAME},
and {LASTNAME}, represent the places where the database
information will appear on the page.
Call a function from the EGL library
About this task
The next step is to add code to this page that calls a function in the CustomerLibrary.egl library. That function reads the data from the database and makes it available to the page.
Procedure
Results

If you see any errors marked by red X symbols in the editor, make sure your code matches the code in this file: Completed allcustomers.egl file after lesson 6.
Test the page
About this task
Now the page is ready to be run on the server. Follow these steps to test it and see how the database data appears on the page.
- Save both the allcustomers.egl and allcustomers.jsp files if you have not already done so, then close both files.
- Make sure your application server is started and synchronized.



