An Oracle JDeveloper How To Document
In a Struts / JSP application JDeveloper 10g provides a simple way of creating bound input forms allowing you to drag the basic form from the relevant collection in the data control palette. Furthermore you can render individual input fields in a variety of ways, in this case we'll look at creating a databound pop-list (drop down list) step by step.
In this example we'll be using a screen created with a basic input form based on the Employees table from the Oracle standard HR demo schema. The model project for this example uses ADF Business Components to expose record collections for the Employees (the basis of the form), and a second record collection containing all Departments which will be used to populate the pop-list.
So in this tip we'll go through the steps required to replace the circled Department ID number field with a bound pop list that contains the names of all the Departments.
Delete the existing field (This can just be done in the JSP visual editor).
Open the Data Control palette, expand the EmployeesView collection and select the DepartmentId attribute. In the
Drag and Drop As poplist at the bottom of the Data Control Palette select the control type
Single Select List.
Drag the selected DepartmentId attribute from the palette into the space vacated by the DepartmentID field that you have just deleted. You should see it dropped as a pop-list widget.
Now click on the UI Model Tab (
) of the Structure Pane on the page you will see the following structure:
Notice the DepartmentId1 attribute at the bottom of this list - this is the binding for new list item that you just created.
Double click (or choose Edit from the context menu) on this new binding. The List Binding Editor will appear:
List Binding Mode: poplist at the top of the dialog to change the mode to LOV Mode:
This dialog has a Source Data Collection which will be a record collection (e.g. a Business Components View Object) which will provide the valid list of values. The Target Data Collection is preselected and represents the data collection that the input form is based on.
The ADF Model data binding mechanism provides a powerful and convenient mechanism for creating data bound lists of values. This how-to has described the creation of drop down lists, but the same principles can be applied to create multi-select lists and radio groups.
drmills v1.1 09-Feb-2004false ,,,,,,,,,,,,,,,