Thursday, August 7, 2014

ADF PASSIVATION/ACTIVATION - previously selected row gets populated in detail ViewObject, even it doesn't belong to Master ViewObject

JDeveloper 11.1.1.7

Updateable detail view object with viewCriteria applied at application module level, populates previously selected row from another parent, this only happens when running the application while application module pool set off to force Passivation/Activation, and the detailed viewObject have a viewCriteria applied to it.

This is reported to Oracle under (Bug 19203478 - ADF PASSIVATION/ACTIVATION - PREVIOUSLY SELECTED ROW GETS POPULATED).

A sample ADF application is attached here (EmplDeptPassivate.zip)

To reproduce this:
- Create new ADF application with default Model project and view Controller
- Database connection points to HR schema
- Create Business components from tables, only select Employee and Department tables, don't add the view Objects to application module.
- Add DepartmentView as master vo then EmployeesView as detail for departments.
- Create view criteria("EmployeesViewCriteria") in EmployeesView where ManagerId=102
- Return back to application module -> data model and edit EmployeeView1 and apply the view criteria.
- Set Application Module pool off, and disconnect upon release on
- Create a view criteria in DepartmentView to search for department name used in search page only.
- Create two ADF pages in bounded or unbound Taskflow
- First page drag DepartmentViewCriteria and add Query with Table, select single selection, filtering and sorting
- Second page drag EmployeeView1 as table, select single selection, filtering and sorting.
- Add navigation links between the two pages, convert department id outputText to link and set the action to the detail page(Employee page)
- Add back and commit buttons to the Employee page
- back should navigate back to search Departments page
- commit because we will change one record at first time
- run the Department Search page
- Search and select the first department with id=10
- Change the manager ID to 102 and save
- Back
- navigate to Department id=60 IT or any other department it shows the selected record from department id=10
- rerun the application many times as you want with changing the manager id to 102 this time because its one time change only, problem will still persists
- enable application module pool on again, problem disappears.

As a workaround to solve this problem, just change the ViewObject that have the ViewCriteria to expert mode VoilĂ .

No comments:

Post a Comment