|
Workaround for JDev 9.0.5.2 Bug Where Page Updates Can Get Ignored
Bug 3608723 -- which is fixed in JDeveloper 10.1.2, but relevant to understand if you are still on 9.0.5.2 -- describes a situation where user-entered data submitted in a web page can get ignored by the ADF DataAction. The ingredients required to encounter the problem are:
- Visit an ADF DataPage that renders an input form
- Cause another DataPage to display
- Submit the page from step 1 with the user's edits
There are three situations in which I've seen customers encounter this sequence of steps:
First Scenario (Browser Back Button)
- User visits a DataPage that renders an input form
- User clicks a hyperlink to visit a different DataPage
- User presses the browser back button, and tries to submit the form from step 1 with their edits
Second Scenario (Frameset)
- User visits a DataPage that renders an input form in one frame of a frameset
- User clicks a hyperlink that targets a different frame in a frameset to show a different DataPage
- User submits the form from step 1 with their edits
Third Scenario (Popup Window)
- User visits a DataPage that renders an input form
- User clicks a hyperlink that pops-up a different DataPage in another window
- User submits the form from step 1 with their edits
In all three of these scenarios, under the covers the same thing is happening at the ADF DataAction level:
- The BindingContainerActionForm (named "DataForm" in struts-config.xml) is used by FirstPageUIModel binding container to reflect Struts dynaform properties corresponding to the binding container's value bindings.
- The BindingContainerActionForm is used by AnotherPageUIModel binding container
- FirstPage.jsp posts back to "/FirstPage.do" which wants to post data to the BindingContainerActionForm with the right attributes for the bindings in the FirstPageUIModel binding container, but instead the edits are ignored.
The problem was caused by the fact that the BindingContainerActionForm was trying to be too smart about remembering which Binding Container used it last in order to try and prevent data from one binding container from being posted into the bindings of a different binding container inadvertently.
As mentioned above, the problem has been fixed in the JDeveloper 10.1.2 maintenance release, but if you need to stay in JDeveloper 9.0.5.2 for now, you can consider adopting the following workaround:
Step 1: Add a form bean named "None" to your struts-config.xml file like this:
<form-beans> <form-bean name="DataForm" type="oracle.adf.controller.struts.forms.BindingContainerActionForm"/> <!-- Add the following entry --> <form-bean name="None" type="org.apache.struts.action.DynaActionForm" dynamic="true"/> </form-beans>
This adds a dynaform bean with no attributes. Why do we do this? Because if we just blank out the Form bean name, the ADF design time will put it back to "DataForm" for you. So, once you define this "None" form bean, then do step 2:
Step 2
Set your read only DataPage (in steps #2 of the three scenarios noted above) to have a form bean of "None" (the one named "None" we just defined above)
By doing this, the ADFBindingContainerActionForm is not used when rendering the read-only page, and so it does not think that the last binding container it worked with was that one anymore.
|