Master-Details update forms are commonly used for selecting an item from a list and then updating the details of that item. This example will show how you can easily set up a form to select an employee and update the employee details.
This tutorial uses an ICE dataTable with a rowSelector.
Here is the entire list of steps worked through during this tutorial:
[Make the masterDetails Project|]
[Deploy the Application|]
[Tutorial Source Code Downloads|]
Development Tools Used
The following tools were used to create the project.
Add the icefaces.jar (from the ICEfaces 3 bundle) to your project, either through a custom User Library or by putting them into masterDetails /WEB-INF/lib/. The approach doesn't matter as long as the jars are included in the deployed war file.
3. Create masterDetails.xhtml
Create a new page called masterDetails.xhtml and paste the code below:
This class is ViewScoped so one bean instance will be created for each client session. The current HTTP session ID for this client will be tracked. An instance of the MessageBean is injected so that text can be added as needed.
Currently no Ajax Push is used in the above code, since we will add that further below.
6. Deploy the Application
Once the application is built and deployed and running it will look fairly basic. Clicking a color button will refresh the list of messages, since no Ajax Push has been added yet. Ideally we want to be able to open multiple web browsers and see each others color choices immediately through Ajax Push.