I need to transfer the attribute values from one managed bean to anather managed bean, Could anyone please let me know how to accomplish this?
I want to transfer a list attribute value of ActivePackagesMB.java Managed bean to anather managed bean.
Thanks & Regards,
Sandeep Dwivedi
Bauke Scholtz
Ranch Hand
Joined: Oct 08, 2006
Posts: 2458
posted
0
There are several ways. Here are some in the order of my personal preference:
1) Inject the another managed bean as a property of the one managed bean and just use it. Here is an example.
2) Obtain the another managed bean by FacesContext and set it as a property. Here are some ways.
3) Pass it through the session map which you obtain using ExternalContext#getSessionMap(). Let the one bean put the desired value in it and let the other bean get it. Here is an example.
Advantages of using this approach is that it will automatically "resolve" the scope of the managed bean that you are after. Of course, you can perform introspection using without actually having to get the actual managed bean.
Regards.
Uy Jerwin Louise Vergara
Junior Developer / Research and Development at Incuventure Partners Corporation
email: jerwin.uy@incuventure.net
Sandeep Dwivedi
Greenhorn
Joined: Jul 09, 2008
Posts: 15
posted
0
Thanks Guys! I highly appreciate your help.
subject: JSF - Managed Bean to Managed Bean Communication