I am trying pass a java object to a popup window after a jsf ajax request. When the user clicks on a h:command button, the application does an ajax request. In an actionListener method of a session scope managed bean I create a big object with data. When the ajax request returns to the client, I am opening a popup window to show the data of the object created in the previous action listener method.
I don't want save the object in the session and I cannot use the object like a request managed bean, because the ajax request finish before than the popup is opened, and the popup is opened in a different page and a Request Scope bean it is not available in the new request.
I thing that I cannot use a View Scope bean to save the object, because the popup is a different view. I cannot use view params because I need a converter to transform the object created in String properies and the object has many properties. Now I am trying to pass the data from the main window to the popup using the flash scope. But I cannot do a sample page to pass data between a main window and a new page opened in a popup.
Look at the next sample:
index.xhtml
ControlledBean.java:
popupwindow.xhtml
RequestBean.java is a simple POJO
At the end the input "result" in popupwindow.xhtml shows nothing, I am trying to see in this input the value "Value created in ActionTest". Any help, tip, sugestion?
Thanks for your time.
If a session bean instance is participating in a transaction, it is an error for a client to invoke the
remove method on the session object’s home or component interface object. The container
must detect such an attempt and throw the javax.ejb.RemoveException to the client.
The container should not mark the client’s transaction for rollback, thus allowing the client to
recover.
An entity manager whose transactions are controlled by the application through the EntityTransaction
API is a resource-local entity manager. A resource-local entity manager transaction is mapped
to a resource transaction over the resource by the persistence provider. Resource-local entity managers
may use server or local resources to connect to the database and are unaware of the presence of JTA
transactions that may or may not be active
A persistence unit that is defined at the level of an EJB-JAR,WAR,
or application client jar is scoped to that EJB-JAR, WAR, or application jar respectively and is visible to
the components defined in that jar or war. A persistence unit that is defined at the level of the EAR is
generally visible to all components in the application.