Forum Stats

  • 3,826,880 Users
  • 2,260,721 Discussions
  • 7,897,109 Comments

Discussions

LOVs based on imported jars - not working

Stuart Fleming
Stuart Fleming Member Posts: 391
edited Aug 4, 2016 11:13AM in JDeveloper and ADF

Jdeveloper 12.1.2

I have created an adf library jar containing a model project that contains a commonly used read-only view object that we want to use for LOVs.  we want to add this jar to other model projects and use the view object to create LOVs on view objects in these applications.

These are the steps I followed:

1.  Add the adf libary jar to the Application (model project).

2. Create a LOV (choice) on the attribute and base it on the view object in the imported Jar.

3.  From the data control, drag the view object (which contains the attribute with the LOV) onto a JSF as an ADF Form.  I add navigation buttons.

4.  I run the form.

Running the form the LOV does not work.  It shows Not the actual value for field, but instead the first record in the LOV.

if I press next to go to the next record I get an error saying a selection is required.

However, if I create the same view object that is in the jar in the ADF application and use this local view object as the source of the LOV (and re-create the ADF form), then when I run it, the LOV shows the correct value in the LOV (which represents the data in the table).  When I press Next, the value in the LOV changes as I scroll through the records.

Re-use is the ADF mantra.  Is it possible to use a Jar that contains a view object and create LOVS that show the data in the actual table (and not just in the list)?

Thanks,

Stuart

Tagged:
Cheena M-Oracle

Best Answer

  • Cheena M-Oracle
    Cheena M-Oracle Member Posts: 24
    edited Aug 3, 2016 2:33PM Answer ✓

    Hi,

    It is definitely possible to Re-use the VOs and other ADF components.

    I followed same steps as you mentioned to create a sample application:

    I created an application with 2 Model projects and 1 ViewController project.

    In First Model Project I created EO and VO of my list table and in second Model Project, I added JAR of first Model project as library and created parent VO, with attribute using List VO from first Model project.

    On creating Editable/non-editable ADF Forms/Tables on ViewController project page, I don't see any such error or issue. My code runs as expected.

    There must be some issue with the way you have implemented dependencies.or created LOV on attribute.

    Try creating a fresh project once again in a new application, I am sure it will work.

    If you need, provide me your email address, I will send you my POC for the same.

    Thanks,

    Cheena

Answers

  • Cheena M-Oracle
    Cheena M-Oracle Member Posts: 24
    edited Aug 3, 2016 2:33PM Answer ✓

    Hi,

    It is definitely possible to Re-use the VOs and other ADF components.

    I followed same steps as you mentioned to create a sample application:

    I created an application with 2 Model projects and 1 ViewController project.

    In First Model Project I created EO and VO of my list table and in second Model Project, I added JAR of first Model project as library and created parent VO, with attribute using List VO from first Model project.

    On creating Editable/non-editable ADF Forms/Tables on ViewController project page, I don't see any such error or issue. My code runs as expected.

    There must be some issue with the way you have implemented dependencies.or created LOV on attribute.

    Try creating a fresh project once again in a new application, I am sure it will work.

    If you need, provide me your email address, I will send you my POC for the same.

    Thanks,

    Cheena

  • Stuart Fleming
    Stuart Fleming Member Posts: 391
    edited Aug 4, 2016 9:57AM

    Thanks.

    There was some corruption in the jar view object.  I tested as you suggested, and was able to make it work.

    Stuart

  • Stuart Fleming
    Stuart Fleming Member Posts: 391
    edited Aug 4, 2016 11:13AM

    Also, one thing I was doing was dragging the LOV onto the screen (and then removing the value property) so that it could be used as an independent LOV to query on. It works usually, but I had some code that ran a executeEmptyRowSet(); This caused the table on the page to load with no records (a wanted functionality), but also left the LOV with no "list".  Once I took out the executeEmptyRowSet the list populated properly.

    Cheena M-Oracle
This discussion has been closed.