Adding a Data Grid
After you create the Client Data Object, add a Data Grid and bind it to the Client Data Object using the following steps:
- Expand the Faces Client Components drawer in the palette.
- Drag a Data Grid on to the page. A Data Grid is displayed on the Design tab.
- In the Client Data view, drag emp (EMPLOYEE[]) onto the Data Grid component to bind the data to the data grid. All columns of the EMPLOYEE table are shown in the Data Grid.
- Select the Data Grid, and go to the Properties view.
- Type 5 in the Height field to show five rows of data per page.
- Click the Columns tab to change values of the column headings and column width.
- Enter the following values in the Label columns: Employee Number; First Name; Initial; Last Name; Department; Phone; Hire Date; Job; Education; Sex; Birth Date; Salary; Bonus; Comm.
- Select the MIDINIT row.
- Change Width to 15 pixels.
- Select the HIREDATE row.
- Select the Column details tab, and change Format to Date/Time.
- Select the BIRTHDATE row.
- Select the Column details tab, and change Format to Date/Time.
- Select the Salary row.
- Select the Column details tab, and change Format to Number.
- Select the BONUS row.
- Select the Column details tab, and change Format to Number.
- Select the COMM row.
- Select the Column details tab, and change Format to Number.
Save and run the JSP on a test server. After the JSP is compiled and run, you are able to interact with the application.