Skip to Main Content

ADF issue with separate Add Record page

DebWilliamsJul 23 2021 — edited Jul 24 2021

I have migrated a web application from ADF to ADF 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
The current functionality worked in JDev12.2.1 and; however migrating to 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:
<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"
<action id="CreateInsert" Action="createInsertRow" RequiresUpdateModel="true"
Any help would be appreciated.

Post Details