Binding a Visual Web JSF Table Component to a Database

See Also

During Visual Web JSF development, when you bind a Table component to a database, you create a connection between the Table component and a database table. After you bind, check the table layout as described below to ensure that the columns are displayed in the correct order.

To set up the database table and component:

  1. Add the table component to the page.
  2. If you are not connected to the database, in the , connect now.
  3. In the database-name node, expand the Tables node to see the tables in the database.

To drag and drop a database table onto the Table component:

To bind a Table component to a database table that has already been added to the page:

  1. Select the entire Table component.
  2. Right-click and choose Bind to Data.
  3. In the Table Layout dialog box, choose the data provider to which you want to bind the Table component and click OK.

    When the dialog box closes, the Table component reformats to show the same columns as the database table.

To check and adjust the table layout:

  1. In the Visual Designer, right-click the border of the table and choose Table Layout.
  2. In the Table Layout dialog box, select columns from the Available list on the left side.
  3. Move the columns to be displayed in your application to the Selected list by selecting each column and clicking the > button.
  4. Move the columns that you do not want to display out of the Selected list by selecting each column and clicking the < button.
  5. You can change the order of the columns by selecting a column and clicking Up or Down.
  6. When the Selected list shows the columns in the desired order, click OK.

    In the Visual Designer, you see the columns displayed in the Table component. Each column shows the data for the database column it displays.

See Also
About Binding Components to Data
Bind to Data Dialog Box: Table Component
About Components and Data
Adding Components to a Visual Web JSF Page
Adding a Database Connection
Adding a Database Table to a Visual Web JSF Page
JavaServer Faces Expression Language

Legal Notices