Forum Stats

  • 3,757,022 Users
  • 2,251,184 Discussions
  • 7,869,692 Comments

Discussions

ADF 12.2.1.4 issue with separate Add Record page

DebWilliams
DebWilliams Member Posts: 2 Red Ribbon
edited Jul 24, 2021 12:37AM in JDeveloper and ADF

I have migrated a web application from ADF 12.2.1.3 to ADF 12.2.1.4. The behavior for the "Add Record" is no longer working as expected. I have tried several different approaches and I cannot get the Add page functionality to work for 12.2.1.4.

The current functionality worked in JDev12.2.1 and 12.2.1.3; however migrating to 12.2.1.4 has introduced issues that I have not been able to find a resolution for.

The original code implemented a Search Page and a separate Add Page.


For example:

The Search Page has a RichTable containing a list of available records from the Employee table.

The RichTable is enclosed within a PanelCollection and contains Add and Edit buttons.

The Add button action navigates to a new page to Add an Employee Record. The Add Employee Page uses an <invokeAction> which executes the "createInsertRow" action which binds with the EmployeeViewIterator (EmployeeView) defined in the AddEmployeePageDef.

The EmployeeViewIterator is also used in the Employee Search Page.

The Add Employee Page is displayed, the new Row is created; however the page is displayed with the attribute values from the CurrentRow that was selected before calling the "createInsertRow" action.


When debugging the code, I can see the Iterator is refreshed 3 times.

The first time, the Iterator is refreshed and the First Row in the search results is set as the CurrentRow.

The second time, the Iterator is refreshed, it contains the New Row.

However before rendering the page, the Iterator is refreshed again and the Current Row has changed to whatever the Current Row was that was selected in the Employee Search Results table before selecting the Add Button.


The following code snippet is used in the EmployeeSearch.jspx file:

...

  <af:panelCollection>

     <f:facet name="menus"/>

     <f:facet name="toolbar">

      <af:toolbar id="t1">

       <af:group id="g1">

   <af:button id="addButton" text="Add" action="AddEmployee" partialSubmit="false"/>


The following code is used in the AddEmployeePageDef.xml

...

<iterator id="EmployeeViewIterator" Binds="EmployeeView" RangeSize="10"

       DataControl="MyAppModuleDataControl" Refresh="ifNeeded"/>

<invokeAction id="CreateNewRow" Binds="CreateInsert" Refresh="renderModel"

         RefreshCondition="${!adfFacesContext.postback}"/>

...

  <action id="CreateInsert" Action="createInsertRow" RequiresUpdateModel="true"

      IterBinding="EmployeeViewIterator"

      InstanceName="MyAppModuleDataControl.EmployeeView"

      DataControl="MyAppModuleDataControl"/>

...

Any help would be appreciated.

Answers

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 37,540 Red Diamond

    InvokeAction?

    Aren't they deprecated?

    From the description, the flow is hard to understand.

    Can you provide some images?

    A reproducible test case might help as well.


    Timo


  • dvohra21
    dvohra21 Member Posts: 14,226 Gold Crown

    The migration path is supported. How was the application migrated?

    Just open ADF 12.2.1.3 app in JDev 12.2.1.4. Issues, if any, shall get listed.

  • DebWilliams
    DebWilliams Member Posts: 2 Red Ribbon

    Thank you, Timo. Yes, I realize the invokeAction is deprecated. The application was originally migrated from ADF 10.1.3.5 to ADF 12.2.1.0, 12.2.1.3, and then 12.2.1.4. The invokeAction functionality, although deprecated, still worked. I will have to update the code to replace the functionality for the invokeAction at some point.


    The web application was successfully migrated to each version of ADF, deployed to WebLogic, and working. The last Version 12.2.1.3 was deployed successfully.

    The issues I am having were all introduced after migrating from 12.2.1.3 to 12.2.1.4.


    I believe I have found the cause for the New Row not being displayed in the Add page.

    In JDev 11.1.2, the changeEventPolicy was updated to default to "ppr" instead of "none".

    The changeEventPolicy did not impact our application for version 12.2.1.0 or 12.2.1.3.

    However, version 12.2.1.4 is refreshing the Iterator several times. The end result is the Iterator is refreshed again after the New Row is created and before the Page is displayed - which is removing the New Row, after it is created.

    After setting the changeEventPolicy to "none", the Add page is initialized as expected, the New Row is created, and now displayed as the Current Row.


    I am still having trouble with the default values not displaying on the Add page, but the New Row is now displayed.


    Thank you for your time!

    -Deb