Adding a Data Grid

The Data Grid allows users to sort, filter, manipulate, and page through data. You bind the Data Grid to a Client Data object and define properties to determine how each column, row, and cell performs. For example, you may want to display the employees in a department. In this scenario, your Page Data Object and Client Data Object return a list of employees.

Use the following steps to put a Data Grid on a JSP page.

  1. In the Web perspective, open your JSP page and the Faces Client Components drawer from the palette.

  2. Drag theData Grid control onto the JSP page.

  3. From the Client Data view, select and drag a list property to the Data Grid component. This step binds the Client Data to the Data Grid

  4. Select the Data Grid component on the JSP page.

  5. Go to the Properties view.

  6. On the odc:datagrid tab, set the number of rows to display per page, specify if rows can be added or deleted, specify a style, and specify if the header and footer navigation bars are shown.

  7. On the Columns tab, specify which columns to display, such as first name, last name, phone, or salary, the width of the column, and a column label.

  8. On the Column details tab, specify how the data in a column is formatted, for example, number, date, string.

  9. Save and run the JSP page on a test server when you have finished

    Note: For more information on the Data Grid, press the F1 key in the Properties view.