« Oracle9i JDeveloper Version 9.0.4.3 available on OTN | Main | UIX LOV Doesn't Return the Selected Value »

UIX LOV Doesn't Return the Selected Value the First Time


The Problem


We have had several customers complaining about the fact that the UIX List of Values (LOV) wasn't working correctly in JDeveloper 10.1.2:

The problem reproduces as the following:
  • no value is returned from the LOV:
    • you create a new Row in a UIX page
    • you click a LOV icon to run a  LOV window
    • you select a value from the LOV window
    • you close the LOV window by clicking on the "Select" button
    • the selected value isn't displayed in your UIX page

  • the LOV returns a value the second time it's invoked
    • after the first trial as described above
    • you repeat the same operation (launch the LOV window, select a value and click "Select"),
    • this time, a value is returned in the field associated with the LOV
The same steps did work in JDeveloper 9.0.x releases, and it still work for pages that were migrated to JDeveloper 10.1.2
It doesn't work for new pages created in JDeveloper 10.1.2


The Cause


The functionality of the "Create" Action Binding has changed between JDeveloper 9.0.5.2 and 10.1.2
.
In JDeveloper 9.0.5.2 (and prior releases), the "Create" action binding was calling the 2 View Object methods: createRow() and insertRow().
Method createRow() does create a new row;
method insertRow() does insert the row in the RowSet. This method sets the current row to the row just inserted

In JDeveloper 10.1.2, the "Create" action binding calls the createRow() method only.
We implemented this change to avoid the "blank row" problem as described in document "Avoiding the Blank Row Issue in ADF Business Components Web Applications" from Steve Muench.

The problem is that the selected value actually ends up in the current row (the current row isn't changed by the call of createRow() method only). The page is then submitted and the new row inserted in the Row Set.
If you invoke the LOV a second time, then it returns the value as expected.

If you have acess to to MetaLink, you can read the following documents about the problem:

Note 299860.1: UIX LOV Returns the Selected Value in Another Row
Bug 4201020: UIX LOV VALUE SET IN EXISTING ROW INSTEAD OF NEW ROW W/ "CREATE" ACTION BINDING


The Solution


Change the binding for the Create action from "Create" to "CreateInsert" as explained below:
  • With your UIX page selected, click on "UI Model" (3d toolbar button) in Structure pane as shown in the next figure:

    UIXLOV_Structure:

    Figure 1 - UI Model toolbar button

  • Double-Click on "Create" under UI Model as shown in the next figure:

    UIXLOV_Create:

    Figure 2 - Create Action Binding

  • This opens the 'Action Binding Editor';
    Change "Select an Action" from "Create" to "CreateInsert" as show in the next figure:

    UIXLOV_CreateInsert:

    Figure 3 - Action Binding Editor

  • Click OK.
  • Run your application; this time, the LOV will behave as expected directly.
NB: you can check the Action Binding in your <name>UIModel.xml file
      <DCControl
         id="Create"
         SubType="DCAction"
         IterBinding="DeptView1Iterator"
         Action="40"
         RequiresUpdateModel="true" >
      </DCControl>
Action="40" is used for the "CreateInsert"
Action="41" is used for the "Create" 

This tip can be convenient for you to assess how many "Create" action bindings (Action="41") you have in your application by using the "Find in Files" utility (menu "Search" -> "Find in Files..." or accelerator Ctrl+Shit+F).
However, you should only modify UIX pages that also include a LOV (UIX component messageLovInput), and always via the aforementioned dialog.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on June 8, 2006 12:00 AM.

The previous post in this blog was Oracle9i JDeveloper Version 9.0.4.3 available on OTN.

The next post in this blog is UIX LOV Doesn't Return the Selected Value.

Many more can be found on the main index page or by looking through the archives.

Top Tags

Powered by
Movable Type and Oracle