View the Data
- Create the web page with "New->Visual Web JSF Page" and a session bean with
"New->Visual Web JSF Session Bean".
- Open the visual web page editor for the created page. Then go to the "Services" tab, connect to the database and select the USERDATA table. Drag and drop it to the editor's canvas. You will see in the navigator window that a Data Provider object and a Row Set object were created.
- Drag and drop a table on the canvas. Select the table, right click and select "Bind to Data". Choose the userdataDataProvider which was created before and click OK. The table is now able to display data for users.
- Deploy the application and point your browser to localhost:8080/b2bua to view the contents of USERDATA.
Create and Delete
- Add a button "Add User" and a button "Save Changes".
- Doubleclick the "Add User" button and enter the action code from the sources.
- Doubleclick the "Save Changes" button and enter the action code from the sources.
- Select the table and open the layout editor. Add a new column and change the type of the column to "Button".
- Doubleclick the "Delete" button and enter the action code from the sources.
- Deploy the application again. You can now create and delete user data. The changes are stored in the database when you click "Save Changes".