We had a similar use case where we have an iFrame which renders a portlet view upon clicking a Simple Link outside the iFrame. The slight difference is that the portlet is not empty but instead loads with some information, (for eg. Table of Pending Invoices) with the ability to submit the form after user chooses to set some Flags on chosen Invoices.
So far so good. There is another link that must display Table of Pending Invoices Greater than $1,000,000.00 ( you wish !!). We chose to reuse the previous portlet to display this table by invoking the same webservice with a different Input.
Now the fun part. If the user chooses to see the list of Pending Invoices and then to see the list of High Value Invoices (without submitting the previous form), the previous data is still displayed.
Ok, I know the reason why. It is because the Form has already been “initialized” and the “initialize” method does not get executed. Fair enough, I set “initialized = false” in the initialize method after initializing. This worked almost fine. But, this had side effects in that if the user had entered some data in the rows and navigated to other data pages, the entered data was lost.
We tried a few more things, but we were hard pressed on time and chose to create a new portlet.
Perhaps an Extended Portlet URL with Reset State = true is ideal for this use case.
This use case will become more and more common and the ability to have reusable portlets would largely help in gaining client’s confidence on Rapid Application Development.
I saw there was a new method callInitialize (perhaps introduced in CAF 8.0) in the BasePortletPageBean but could not find any Java Docs on this.
How do you suggest we handle cases like this?