Forum Stats

  • 3,782,046 Users
  • 2,254,585 Discussions
  • 7,879,901 Comments

Discussions

LOV drop down problem when inserting data

3265832
3265832 Member Posts: 54
edited Sep 13, 2016 10:12AM in JDeveloper and ADF

Hi everyone, I have two entities, to simplify it I'll call them Employees and Person. In Employees I have an EmpID that is connected to Person also through EmpID. Now I've put an editable table on my ADF page that shows employees but I'd like to have a dropdown list of values containing names from Person table inside my Employees Table. So I go to my Data Controls, inside Person view and select Name and drag it to Column in Employees. Then I select single selection -> adf select single choice and set my base data source to be Employees, set my list data source to be person and map them to use EmpID in both tables, and Display attribute the name from person table. When I do that every single row in my table is the same name, although the IDs are different. What am I doing wrong ? Thank you.

Tagged:
3265832

Best Answer

  • Ao Bie
    Ao Bie Member Posts: 294
    edited Sep 8, 2016 10:53AM Accepted Answer

    Hi there:

    When you drag drop Person name into Employee table on UI, it will always display Person View object's current row at runtime. What you need to do is:

    1) go to your Employees View Object (for good naming convention, your view name should not use plural , it should be called EmployeeView or EmployeeVO), go to EmpID column, look for the 'List of Values' tab:

    pastedImage_0.png

    2) Click on the green '+' sign to add your list data source:

    pastedImage_1.png

    3) in the UI hints you can choose Person name instead of EmpID so that person name will be displayed as drop down on UI.

    After these, you drag and drop your Employee table again on UI page, by default empID will be type of af:selectOneChoice, or you can manually change to it if it is not defaulted as af:selectOneChoice somehow.

    Thanks,

    32658323265832

Answers

  • Ao Bie
    Ao Bie Member Posts: 294
    edited Sep 8, 2016 10:53AM Accepted Answer

    Hi there:

    When you drag drop Person name into Employee table on UI, it will always display Person View object's current row at runtime. What you need to do is:

    1) go to your Employees View Object (for good naming convention, your view name should not use plural , it should be called EmployeeView or EmployeeVO), go to EmpID column, look for the 'List of Values' tab:

    pastedImage_0.png

    2) Click on the green '+' sign to add your list data source:

    pastedImage_1.png

    3) in the UI hints you can choose Person name instead of EmpID so that person name will be displayed as drop down on UI.

    After these, you drag and drop your Employee table again on UI page, by default empID will be type of af:selectOneChoice, or you can manually change to it if it is not defaulted as af:selectOneChoice somehow.

    Thanks,

    32658323265832
  • 3265832
    3265832 Member Posts: 54
    edited Sep 13, 2016 8:45AM

    Thank you very much, this has solved my problem, although I don't know why it didn't work when the table was already displayed. I had to remove the table, add LOV to my viewobject and then drop the table again.

    Thank you very much again !

    3265832
  • amyM-Oracle
    amyM-Oracle Member Posts: 9 Employee
    edited Sep 13, 2016 9:19AM

    Hi,

    It's because the data controls that existed when you first dropped the table onto the page, did not have the LOV associated to the empid.  In order to pick up the changes from the data controls, you have to re-drop the table from the DC onto the page.

    Thanks

    32658323265832
  • 3265832
    3265832 Member Posts: 54
    edited Sep 13, 2016 9:52AM

    Oh so that is how it works. Thank you very much for your explanation !

  • Ao Bie
    Ao Bie Member Posts: 294
    edited Sep 13, 2016 9:58AM

    Then my answer is correct, please mark it as the correct answer. Thank you!

This discussion has been closed.