On Wed, Feb 29, 2012 at 8:10 PM, Dan Retzlaff <[email protected]> wrote:
> Your description is clear, thank you. I'm not certain that the background
> thread's reference to the Session is valid outside of the servlet request.
> I would verify your assumption by logging the session's object ID when the
> value is read/written.
>
> I have one other thought for you. I believe Wicket keeps the most recent
> page in a deserialized state to save itself the work of deserialization in
> the common case of it being required by the next request. (I think the
> logic is in PageStoreManager, but it's not clear to me. Hopefully a dev can
> confirm/correct me.)

More about this at:
https://cwiki.apache.org/confluence/x/qIaoAQ

> At any rate, this may cause the difference between
> your two scenarios. In your successful, single-tab scenario, you may be
> benefiting from a lack of serialization/deserialization round-trip. We have
> noticed this difference when our components have transient variables that
> aren't set to null in detach(): in the most recent page the variable
> remains not-null; if the session has intermediate requests for other pages,
> the variable is null when next accessed.
>
> Good luck,
> Dan
>
> 2012/2/29 "André Schütz" <[email protected]>
>
>> Hi,
>>
>> Page1 gets the click of the submit button and collects the search word.
>> This will be changed into a hash value and set as PageParameter
>> (q=Hashvalue) to the ResponsePage which is Page2.
>> Additionally, I store the hash value into a session HashMap which holds
>> the hash value as key and an own class with the original search word. This
>> class will be filled with the results from the search of the background
>> thread.
>>
>> On Page2, I have the PageParameter as hash value and can search for the
>> correct entry of the HashMap in the session to react, when the results are
>> found.
>>
>> I hope, I could describe it.
>>
>> Andre
>>
>> -------- Original-Nachricht --------
>> > Datum: Tue, 28 Feb 2012 14:27:35 -0800
>> > Von: Dan Retzlaff <[email protected]>
>> > An: [email protected]
>> > Betreff: Re: Multi Tab and Session
>>
>> > Hi Andre. I'm trying to understand your setup. A quickstart may be
>> > required.
>> >
>> > What does your Page1's onSubmit() look like? Specifically I'd like to
>> know
>> > how Page2 knows to watch for "word2".
>> >
>> > 2012/2/28 Andre Schütz <[email protected]>
>> >
>> > > Hello,
>> > >
>> > > I have a problem with my application that I am not able to solve since
>> > >  the last three days.
>> > >
>> > > I realized that Wicket 1.5 provides multi tab / multi window support
>> > > for more than one opened tab in a browser.
>> > > I have a problem with multiple tabs in my program, that I want to
>> > > describe now.
>> > >
>> > > The program consists of two pages. Page1 contains a search field that
>> > > will be used to type in a search word.
>> > > Page2 makes the search on a database, returns the results and
>> > > displays it as a list. The search will be done from a background
>> > > thread that stores the result in a hashmap in the session with the
>> > > search word as the key. Furthermore, Page2 shows a little loading
>> > > animation that will be updated (AjaxSelfUpdatingTimerBehavior), when
>> the
>> > > result is stored in the session.
>> > >
>> > > Now the problem.
>> > >
>> > > (1) I open the application in two tabs of the same browser.
>> > > (2) The URL looks as follows:
>> > > Tab1 - localhost:8080/appli/?0
>> > > Tab2 - localhost:8080/appli/?1
>> > > (3) Tab1 gets word1 in the search field and Tab2 gets word2
>> > > into the search field.
>> > > (4) I press the submit button of Tab1, switch to Tab2 and press the
>> > > submit button, too.
>> > > (5) The two Threads start to search for the results.
>> > > (6) During the AjaxSelfUpdatingTimeBehavior, the result panel of Page2
>> > > checks
>> > > in its overwritten onBeforeRender method for the results. When the
>> > result
>> > > for the search word is found in the session, the updateBehavior of
>> Page2
>> > > is stopped and the results will be displayed.
>> > > -> Here starts my problem:
>> > >
>> > > None of the two pages will be updated and show the results. If I start
>> > > the search in one of the Tabs, the process will be finished and the
>> > > results displayed onto the screen.
>> > >
>> > > For me, it seems that both tabs share the same session data and also
>> > > the same updateBehavior on the Page2.
>> > >
>> > > Can anybody help me with that problem? Would be great.
>> > >
>> > > --
>> > > Andre Schütz <[email protected]>
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: [email protected]
>> > > For additional commands, e-mail: [email protected]
>> > >
>> > >
>>
>> --
>> Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
>> belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to