Your best bet general-purpose is to subscribe action listeners.
If the relationship is simple and not subject to change, you can simply chain actions, since an action process is nothing but a method accepting void and returning a string. Just inject the dependent bean into the bean that gets fired first and invoke the second action on the dependent bean.
Sometimes the only way things ever got fixed is because people became uncomfortable.
Every action has an string that represents a logical outcome in the faces-config.xml. If you do not want to navigate to another resource, then an actionlistener.
My suggestion is to delegate the business logic inside action1 and action2 to POJO classes, which could replace both actions with a single action that delegates processing to POJO classes. Of course, other managed bean can extend this behaviour that would increase reuse of action1 and action2.
Uy Jerwin Louise Vergara
Junior Developer / Research and Development at Incuventure Partners Corporation
What I have are three beans, the first is used for login, the second to handle some forms, and the third to handle file uploads. What I need to do on successful submission of the forms is to update the second and third beans. So rather than controlling the second bean directly by an action, I'm now using the login bean as the master bean, and the action is passed to the second bean, where it is processed as before, and the second and third beans are updated.
Whether this will work or not I hope to find out tomorrow.
Maybe he went home and went to bed. And took this tiny ad with him:
Free, earth friendly heat - from the CodeRanch trailboss