Creating a List of Values with an ADF LOV Binding

You can set an ADF list binding in LOV (list of value) mode for these UI components that you insert from the Data Control Palette into an ADF-enabled web page:

Note: In the case of UIX pages, the MessageLovInput component provides an alternative way to display a selection list for the user. The MessageLovInput, unlike the above list of components, must display the list of values from the same collection that it will perform the update on.

Specifically, a LOV binding lets users select a value from a list that displays the data collection rows of one or more attributes. When the user makes the selection, the LOV updates one or more attributes of another data collection based on their selection. You use the list binding editor in LOV mode to define the source and target data collections, the binding between their attributes, and the attributes to display in the list component.

To define the LOV for display:

  1. Open the Data Control Palette for the ADF-enabled web page and insert the desired list component.

  2. In the Structure window for the open web page, double-click the list binding created for the LOV component.

  3. In the list binding editor, select LOV Mode from the List Binding Mode dropdown list.

  4. Click the LOV Update Attributes tab and select the data collection you want your LOV to use:

    LOV (Source) Data Collection defines the collection that you want to use to display your list of values for selection. This should be a collection that is not constrained by a master data collection in the business services Model project.

    Target Data Collection is the collection that contains the attribute or attributes you want to receive the selected value in the web page. This should be the same data collection that your web page displays.

  5. If the iterator dropdown list already displays a named iterator to access the selected data collection, leave the selection unchanged. If the dropdown appears empty, click New and create the iterator so it appears in the dropdown list.

    Warning: Changing the iterator selection in the dropdown list will remove previously made attribute selections. Before you change the iterator selection, take note of the original attribute selections. If you need to, you can press Cancel to exit the binding dialog without updating the original attribute selections.

  6. Click Add to bind at least one attribute between the two data collections.

    The bottom area of the list binding editor displays a table with a list of possible LOV binding attributes between the collection used to display the list of values and the collection used to receive the attribute selection.

  7. Select the attribute from the LOV Attributes dropdown that you want to use to supply the value to the field displayed in the web page.

  8. Select the attribute from the Target Attributes dropdown that you want to receive the value from the LOV attribute.

  9. Click Add again to bind multiple attributes through the same LOV.

  10. Click the LOV Display Attributes tab and select the attributes that you want the LOV window to display.

    You may add as many attributes as desired to the Selected Attributes list, although you are not required to include the LOV binding target attribute (the attribute that you want to display the updated value). For example, when the LOV windows displays a list of states by full name and the selection updates the target attribute for the state's two-letter postal abbreviation, the abbreviations need not appear in the LOV window.

  11. Click OK to save the binding settings.

Meta-data for the new LOV binding is added to the binding definition file (UIModel.xml):




<DCControl

       id="SameAsSourceLOVAttributeName"

       SubType="DCListSingleSel"

       IterBinding="DataCollectionIteratorId"

       ApplyValidation="false"

       ListOperMode="0"

       ListIter="OrdersView1Iterator" >

       <AttrNames>

          <Item Value="MySelectedTargetAttribute" />

       </AttrNames>

       <ListAttrNames>

          <Item Value="MySelectedLOVSourceAttribute" />

       </ListAttrNames>

       <ListDisplayAttrNames>

          <Item Value="MySelectedDisplayAttribute1" />

          <Item Value="MySelectedDisplayAttribute2" />

            ...

       </ListDisplayAttrNames>

</DCControl>    

To insert a component to display the updated LOV target attribute value:

  1. In the top portion of the Data Control Palette, select the attribute which you previously selected as the LOV binding's target attribute.

  2. From the Drag and Drop As list select the UI component that you want to insert to display the updated attribute value.

  3. Drag the selected attribute from the Data Control Palette into the open web page.

To modify the number of rows to display in the LOV:

  1. With the document open in the Visual Editor, choose View | Structure to open the Structure window.

  2. Click UI Model tab icon (UI Model) in the Structure window toolbar and expand the node to display the list of bindings.

  3. Select the iterator binding which you selected for the LOV's source data collection and choose View | Property Inspector to open the Property Inspector.

  4. In the Range Size field of the Property Inspector, edit the value and press Enter. You can increase the value from the default value of 10 rows.

    Note, the value -1 and 0 have specific meaning: the value -1 returns all available objects from the collection, while the value 0 will return the same number of objects as the collection uses to retrieve from its data source.

For additional information about working with range size, see Limiting Row Fetches Using an ADF Iterator Binding.


About the ADF List of Values (LOV) Binding

Creating a Master-Detail Form with an ADF LOV Binding
Creating an Input Form with an ADF LOV Binding

 

Copyright © 1997, 2004, Oracle. All rights reserved.