I believe that is one of the problems that SEAM conversations solve. Read about them in the docs, I think it is what you want.
Thanks for your answer.
The problem is that this three pieces of data (structure, unit and plan) are used all over the application. In this case, I should have to put all the application in a huge conversation and I think it would create a great number of problems (Starting by the fact that Seam, by default, commits transactions to database at the end of the conversation).
By the way, I have the book JBOSS in Action by Jamae and Johnson. Its a really great book!!
So, if some one has another idea, please let me know.
Thanks in advance,
in this case, I would use conversation-scoped JavaBean or SFSB as backing beans for your xhtml file(s).
How is the data for those 3 objects being populated? db read, etc.?
If it's db read, then I recommend using @Factory/@DataModel combo to populate a list and outject to conversation-context. The extra db hits is not a concern when you use @Factory b/c the method that is associated with the @Factory is only executed when the List associated with @Facotry is null (i.e. that method will only get exec'd once per session unless the List object is explicitly set to null).
look at the hotel booking example (it works with multiple windows/tabs) and read Seam in Action and/or the new Yuan Seam book (2nd ed.)
BTW, it's Seam - not SEAM. It's not an acronym, it's a concept....
actually there's two situations in which the @Factory method will get called more than once per session:
1) when the List object is set to null
2) when the @Factory method is called explicitly
Thanks for your answer.
The three pieces of data are selected in a page that includes that purpose and sent to Session context using:
@In(required = false, create = true) @Out(required = false, scope = ScopeType.SESSION) private OrganizationalStructure selectedOrg; @In(required = false) @Out(required = false, scope = ScopeType.SESSION) private OrganizationalUnit selectedUnit; @In(required = false, create = true) @Out(required = false, scope = ScopeType.SESSION) private StrategicPlan selectedPlan;
The they are injected in all beans that need the piece of data.
@In private OrganizationalStructure selectedOrg;
And there are a lot of beans that get these data injected. It would be really awfull to force the user to select these three entities each time he enters a page.
By the way, while it is true that I have the JBoss in Action book (it was a oooops), I really ment to say I have (and studied) the book JBoss Seam by Michel Juntao and Thomas Heute and it is also a great book!!
Thanks a lot,