-
1. Re: Application runnig in two tabs get messed up
niox.nikospara.yahoo.com Mar 16, 2009 12:41 PM (in response to agurisatti)Hello,
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.
-
2. Re: Application runnig in two tabs get messed up
agurisatti Mar 16, 2009 10:34 PM (in response to agurisatti)Hi Nikos
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,
A. Gurisatti -
3. Re: Application runnig in two tabs get messed up
gonorrhea Mar 16, 2009 10:53 PM (in response to agurisatti)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....
-
4. Re: Application runnig in two tabs get messed up
gonorrhea Mar 16, 2009 10:56 PM (in response to agurisatti)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 -
5. Re: Application runnig in two tabs get messed up
agurisatti Mar 16, 2009 11:41 PM (in response to agurisatti)Hi Ron,
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,
Antonio Gurisatti