Re: Multi Tab and Session

2012-03-02 Thread Andre Schütz
Hi,

I could solve my problem with the reload of the page and
the multi call of the constructors.

This evening, I created a quickstart project to show you
my problem. After finishing the code of the quickstart project,
I could not reproduce my problem. I compared the code from
the quickstart project with my own code and found the 
difference.

I made a mistake during the creation of the background thread 
and the initialization of the AjaxSelfUpdatingTimerBehavior.
The problem was the order.
I created the AjaxSelfUpdatingTimerBehavior before the Background
Thread. After changing this order, I could use my application
in multiple tabs without any problems.

Thanks for the many help.
Andre

On Thu, 1 Mar 2012 23:03:37 +0100
Andre Schütz andre-p...@gmx.de wrote:

 Hi,
 
 I started my project with Jetty from within IDEA to use breakpoints and
 additional informations from the debugger. The Jetty server
 started without any problems, but when I call localhost:8080, I get
 he following error:
 
 Unexpected Runtime Exception
 
 Last cause: Can not determine Markup. Component is not yet connected to a 
 parent.
 [Page class = org.myproject.PageIndex, id = 0, render count = 1]
 
 In my pom.xml, I defined the path to the HTML files for the corresping classes
 as:
 
 build
 resources
 resource
 filteringfalse/filtering
 directorysrc/main/resources/directory
 /resource
 resource
 directorysrc/main/html/directory
 /resource
 resource
 filteringfalse/filtering
 directorysrc/main/java/directory
 includes
 include**/include
 /includes
 excludes
 exclude**/*.java/exclude
 /excludes
 /resource
 /resources
 testResources
 testResource
 filteringfalse/filtering
 directorysrc/test/resources/directory
 /testResource
 testResource
 directorysrc/main/html/directory
 /testResource
 testResource
 filteringfalse/filtering
 directorysrc/test/java/directory
 includes
 include**/include
 /includes
 excludes
 exclude**/*.java/exclude
 /excludes
 /testResource
 /testResources
 plugins
 plugin
 
 Seems to me, that Jetty does not find the .html files?
 
 Andre
 
 
 On Thu, 1 Mar 2012 10:13:00 +0200
 Martin Grigorov mgrigo...@apache.org wrote:
 
  Use mvnDebug instead of mvn at the command line. This will start it in
  debug mode and you can attach to it from IDEA.
  Otherwise Wicket quickstart comes with src/test/java/**/Start.java.
  Run this class as normal Java application with main(String[]). From
  the context menu in the .java file choose Debug 'Start.main()'
  
  2012/3/1 André Schütz andre-p...@gmx.de:
   Hi Martin,
  
   I compile the wicket project via Maven from the command line. I do not 
   use the IDE to start the project and trace it? Do you have a hint how I 
   can do that? As IDE, Ia m using  IntelliJ IDEA.
  
   Andre
  
    Original-Nachricht 
   Datum: Thu, 1 Mar 2012 09:40:30 +0200
   Von: Martin Grigorov mgrigo...@apache.org
   An: users@wicket.apache.org
   Betreff: Re: Multi Tab and Session
  
   2012/2/29 Andre Schütz andre-p...@gmx.de:
Hi,
   
I could identify the cause of the problem, but still have no
solution.
   
I set some breakpoints and made some output messages to trace
the system. The following thinks happened:
   
(1)
I submit a search in Tab1. The search word will be passed as
Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
search in Tab2. Tab2 switches to its Page2 and the loading animation
stops in both Tabs.
   
Reason:
-- The constructors of Page2 is called twice on the two Tabs.
   
As diagram:
01.) Tab1: Page1 submit search
02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
03.) Tab1: shows loading animation with its
   AjaxSelfUpdatingTimerBehavior at PanelA
04.) Tab2: Page1 submit search
05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
06.) Tab2: shows loading animation with its
   AjaxSelfUpdatingTimerBehavior at PanelA
07.) Tab1: Page2 (Page id = 17) calls its constructor
08.) Tab1: does not update anymore
09.) Tab2: Page2 (Page id = 18) calls its constructor
10.) Tab2: does not update anymore
   
I do nothing from the beginning of step 7 and do not know why the
   constructor
is called again.
  
   Put a breakpoint in Page2 constructor and see why it is called.
  
   
(2)
The same

Re: Multi Tab and Session

2012-03-01 Thread André Schütz
Hi Martin,

I compile the wicket project via Maven from the command line. I do not use the 
IDE to start the project and trace it? Do you have a hint how I can do that? As 
IDE, Ia m using  IntelliJ IDEA.

Andre

 Original-Nachricht 
 Datum: Thu, 1 Mar 2012 09:40:30 +0200
 Von: Martin Grigorov mgrigo...@apache.org
 An: users@wicket.apache.org
 Betreff: Re: Multi Tab and Session

 2012/2/29 Andre Schütz andre-p...@gmx.de:
  Hi,
 
  I could identify the cause of the problem, but still have no
  solution.
 
  I set some breakpoints and made some output messages to trace
  the system. The following thinks happened:
 
  (1)
  I submit a search in Tab1. The search word will be passed as
  Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
  animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
  search in Tab2. Tab2 switches to its Page2 and the loading animation
  stops in both Tabs.
 
  Reason:
  -- The constructors of Page2 is called twice on the two Tabs.
 
  As diagram:
  01.) Tab1: Page1 submit search
  02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
  03.) Tab1: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior at PanelA
  04.) Tab2: Page1 submit search
  05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
  06.) Tab2: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior at PanelA
  07.) Tab1: Page2 (Page id = 17) calls its constructor
  08.) Tab1: does not update anymore
  09.) Tab2: Page2 (Page id = 18) calls its constructor
  10.) Tab2: does not update anymore
 
  I do nothing from the beginning of step 7 and do not know why the
 constructor
  is called again.
 
 Put a breakpoint in Page2 constructor and see why it is called.
 
 
  (2)
  The same odd behavior happens, when I do the following. I submit a
 search
  in Tab1 from its Page1. While the loading animation is shown, I reload
 the
  Page1 in Tab2. The constructor of Page2 in Tab1 is called again and the
  Page2 in Tab1 stops its update progress.
 
  As diagram:
  01.) Tab1: Page1 submit search
  02.) Tab1: Page2 (Page id = 22) calls its constructor and adds a PanelA
  03.) Tab1: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior at PanelA
  04.) Tab2: Reload any Page
  05.) Tab1: Page2 (Page id = 23) calls its constructor
  06.) Tab1: does not update anymore
 
 
  I really can't explain to myself, why the constructor is called again.
 But I think
  that this second call in the individual Tabs is crashing my application.
  Any ideas about this odd behavior?
 
  Thank in advance,
  Andre
 
 
  On Wed, 29 Feb 2012 10:10:37 -0800
  Dan Retzlaff dretzl...@gmail.com 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.) 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 andre-p...@gmx.de
 
   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 dretzl...@gmail.com
An: users@wicket.apache.org
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 andre-p...@gmx.de
   
 Hello,

 I have

Re: Multi Tab and Session

2012-03-01 Thread André Schütz
Hi,

I will check, which page ID is in the request and test your quickstart, when I 
am back home this evening. Thanks for the advice.
I will share my results after the tests.

Andre

 Original-Nachricht 
 Datum: Wed, 29 Feb 2012 20:46:22 -0800
 Von: Dan Retzlaff dretzl...@gmail.com
 An: users@wicket.apache.org
 Betreff: Re: Multi Tab and Session

 I reproduced part of your setup with the attached quickstart whose
 homepage
 updates a single label with an AjaxSelfUpdatingTimerBehavior. Reloading a
 page in a second tab (including its version number in the URL) causes
 subsequent requests to the first tab to be considered stale based on a
 page render count. This stops the AJAX updates. So Andre, when you load
 Page1 in Tab2, does your request include the page ID from Tab1?
 
 If this isn't the case, then please share a quickstart of your own.
 Despite
 your detailed description I'm not sure I'm reproducing your steps exactly.
 
 Regarding multiple constructor calls, are you using Chrome 17 or greater?
 It introduces some funky prerendering business that can cause multiple
 requests/constructions when you'd otherwise expect one. I just learned
 this
 today. Typing localhost:8080 into address bar is enough to make the
 request, even without hitting enter. Hitting enter causes another request
 to be made, but it appears it is the first response that is rendered
 (based
 on the page ID in the URL). Interesting.
 http://code.google.com/chrome/whitepapers/prerender.html
 
 Dan
 
 2012/2/29 Andre Schütz andre-p...@gmx.de
 
  Hi,
 
  I could identify the cause of the problem, but still have no
  solution.
 
  I set some breakpoints and made some output messages to trace
  the system. The following thinks happened:
 
  (1)
  I submit a search in Tab1. The search word will be passed as
  Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
  animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
  search in Tab2. Tab2 switches to its Page2 and the loading animation
  stops in both Tabs.
 
  Reason:
  -- The constructors of Page2 is called twice on the two Tabs.
 
  As diagram:
  01.) Tab1: Page1 submit search
  02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
  03.) Tab1: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior
  at PanelA
  04.) Tab2: Page1 submit search
  05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
  06.) Tab2: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior
  at PanelA
  07.) Tab1: Page2 (Page id = 17) calls its constructor
  08.) Tab1: does not update anymore
  09.) Tab2: Page2 (Page id = 18) calls its constructor
  10.) Tab2: does not update anymore
 
  I do nothing from the beginning of step 7 and do not know why the
  constructor
  is called again.
 
  (2)
  The same odd behavior happens, when I do the following. I submit a
 search
  in Tab1 from its Page1. While the loading animation is shown, I reload
 the
  Page1 in Tab2. The constructor of Page2 in Tab1 is called again and the
  Page2 in Tab1 stops its update progress.
 
  As diagram:
  01.) Tab1: Page1 submit search
  02.) Tab1: Page2 (Page id = 22) calls its constructor and adds a PanelA
  03.) Tab1: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior
  at PanelA
  04.) Tab2: Reload any Page
  05.) Tab1: Page2 (Page id = 23) calls its constructor
  06.) Tab1: does not update anymore
 
 
  I really can't explain to myself, why the constructor is called again.
 But
  I think
  that this second call in the individual Tabs is crashing my application.
  Any ideas about this odd behavior?
 
  Thank in advance,
  Andre
 
 
  On Wed, 29 Feb 2012 10:10:37 -0800
  Dan Retzlaff dretzl...@gmail.com 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.) 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 andre-p...@gmx.de
  
Hi,
   
Page1 gets the click of the submit button and collects

Re: Multi Tab and Session

2012-03-01 Thread Martin Grigorov
Use mvnDebug instead of mvn at the command line. This will start it in
debug mode and you can attach to it from IDEA.
Otherwise Wicket quickstart comes with src/test/java/**/Start.java.
Run this class as normal Java application with main(String[]). From
the context menu in the .java file choose Debug 'Start.main()'

2012/3/1 André Schütz andre-p...@gmx.de:
 Hi Martin,

 I compile the wicket project via Maven from the command line. I do not use 
 the IDE to start the project and trace it? Do you have a hint how I can do 
 that? As IDE, Ia m using  IntelliJ IDEA.

 Andre

  Original-Nachricht 
 Datum: Thu, 1 Mar 2012 09:40:30 +0200
 Von: Martin Grigorov mgrigo...@apache.org
 An: users@wicket.apache.org
 Betreff: Re: Multi Tab and Session

 2012/2/29 Andre Schütz andre-p...@gmx.de:
  Hi,
 
  I could identify the cause of the problem, but still have no
  solution.
 
  I set some breakpoints and made some output messages to trace
  the system. The following thinks happened:
 
  (1)
  I submit a search in Tab1. The search word will be passed as
  Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
  animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
  search in Tab2. Tab2 switches to its Page2 and the loading animation
  stops in both Tabs.
 
  Reason:
  -- The constructors of Page2 is called twice on the two Tabs.
 
  As diagram:
  01.) Tab1: Page1 submit search
  02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
  03.) Tab1: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior at PanelA
  04.) Tab2: Page1 submit search
  05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
  06.) Tab2: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior at PanelA
  07.) Tab1: Page2 (Page id = 17) calls its constructor
  08.) Tab1: does not update anymore
  09.) Tab2: Page2 (Page id = 18) calls its constructor
  10.) Tab2: does not update anymore
 
  I do nothing from the beginning of step 7 and do not know why the
 constructor
  is called again.

 Put a breakpoint in Page2 constructor and see why it is called.

 
  (2)
  The same odd behavior happens, when I do the following. I submit a
 search
  in Tab1 from its Page1. While the loading animation is shown, I reload
 the
  Page1 in Tab2. The constructor of Page2 in Tab1 is called again and the
  Page2 in Tab1 stops its update progress.
 
  As diagram:
  01.) Tab1: Page1 submit search
  02.) Tab1: Page2 (Page id = 22) calls its constructor and adds a PanelA
  03.) Tab1: shows loading animation with its
 AjaxSelfUpdatingTimerBehavior at PanelA
  04.) Tab2: Reload any Page
  05.) Tab1: Page2 (Page id = 23) calls its constructor
  06.) Tab1: does not update anymore
 
 
  I really can't explain to myself, why the constructor is called again.
 But I think
  that this second call in the individual Tabs is crashing my application.
  Any ideas about this odd behavior?
 
  Thank in advance,
  Andre
 
 
  On Wed, 29 Feb 2012 10:10:37 -0800
  Dan Retzlaff dretzl...@gmail.com 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.) 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 andre-p...@gmx.de
 
   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 dretzl...@gmail.com

Re: Multi Tab and Session

2012-03-01 Thread Andre Schütz
Hi,

I started my project with Jetty from within IDEA to use breakpoints and
additional informations from the debugger. The Jetty server
started without any problems, but when I call localhost:8080, I get
he following error:

Unexpected Runtime Exception

Last cause: Can not determine Markup. Component is not yet connected to a 
parent.
[Page class = org.myproject.PageIndex, id = 0, render count = 1]

In my pom.xml, I defined the path to the HTML files for the corresping classes
as:

build
resources
resource
filteringfalse/filtering
directorysrc/main/resources/directory
/resource
resource
directorysrc/main/html/directory
/resource
resource
filteringfalse/filtering
directorysrc/main/java/directory
includes
include**/include
/includes
excludes
exclude**/*.java/exclude
/excludes
/resource
/resources
testResources
testResource
filteringfalse/filtering
directorysrc/test/resources/directory
/testResource
testResource
directorysrc/main/html/directory
/testResource
testResource
filteringfalse/filtering
directorysrc/test/java/directory
includes
include**/include
/includes
excludes
exclude**/*.java/exclude
/excludes
/testResource
/testResources
plugins
plugin

Seems to me, that Jetty does not find the .html files?

Andre


On Thu, 1 Mar 2012 10:13:00 +0200
Martin Grigorov mgrigo...@apache.org wrote:

 Use mvnDebug instead of mvn at the command line. This will start it in
 debug mode and you can attach to it from IDEA.
 Otherwise Wicket quickstart comes with src/test/java/**/Start.java.
 Run this class as normal Java application with main(String[]). From
 the context menu in the .java file choose Debug 'Start.main()'
 
 2012/3/1 André Schütz andre-p...@gmx.de:
  Hi Martin,
 
  I compile the wicket project via Maven from the command line. I do not use 
  the IDE to start the project and trace it? Do you have a hint how I can do 
  that? As IDE, Ia m using  IntelliJ IDEA.
 
  Andre
 
   Original-Nachricht 
  Datum: Thu, 1 Mar 2012 09:40:30 +0200
  Von: Martin Grigorov mgrigo...@apache.org
  An: users@wicket.apache.org
  Betreff: Re: Multi Tab and Session
 
  2012/2/29 Andre Schütz andre-p...@gmx.de:
   Hi,
  
   I could identify the cause of the problem, but still have no
   solution.
  
   I set some breakpoints and made some output messages to trace
   the system. The following thinks happened:
  
   (1)
   I submit a search in Tab1. The search word will be passed as
   Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
   animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
   search in Tab2. Tab2 switches to its Page2 and the loading animation
   stops in both Tabs.
  
   Reason:
   -- The constructors of Page2 is called twice on the two Tabs.
  
   As diagram:
   01.) Tab1: Page1 submit search
   02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
   03.) Tab1: shows loading animation with its
  AjaxSelfUpdatingTimerBehavior at PanelA
   04.) Tab2: Page1 submit search
   05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
   06.) Tab2: shows loading animation with its
  AjaxSelfUpdatingTimerBehavior at PanelA
   07.) Tab1: Page2 (Page id = 17) calls its constructor
   08.) Tab1: does not update anymore
   09.) Tab2: Page2 (Page id = 18) calls its constructor
   10.) Tab2: does not update anymore
  
   I do nothing from the beginning of step 7 and do not know why the
  constructor
   is called again.
 
  Put a breakpoint in Page2 constructor and see why it is called.
 
  
   (2)
   The same odd behavior happens, when I do the following. I submit a
  search
   in Tab1 from its Page1. While the loading animation is shown, I reload
  the
   Page1 in Tab2. The constructor of Page2 in Tab1 is called again and the
   Page2 in Tab1 stops its update progress.
  
   As diagram:
   01.) Tab1: Page1 submit search
   02.) Tab1: Page2 (Page id = 22) calls its constructor and adds a PanelA
   03.) Tab1: shows loading animation with its
  AjaxSelfUpdatingTimerBehavior at PanelA
   04.) Tab2: Reload any Page
   05.) Tab1: Page2 (Page id = 23) calls its constructor
   06.) Tab1: does not update anymore
  
  
   I really can't explain to myself, why the constructor is called again.
  But I think
   that this second call in the individual Tabs is crashing my application.
   Any ideas about this odd behavior?
  
   Thank in advance,
   Andre
  
  
   On Wed, 29 Feb 2012 10:10:37 -0800
   Dan

Re: Multi Tab and Session

2012-03-01 Thread Andre Schütz
.
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 dretzl...@gmail.com
 An: users@wicket.apache.org
 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 andre-p...@gmx.de

  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 schuetz.an...@gmx.net
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
   
--
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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
   
   
 
 
  --
  Andre Schütz schuetz.an...@gmx.net
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


-- 
Andre Schütz schuetz.an...@gmx.net

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Multi Tab and Session

2012-02-29 Thread André Schütz
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 dretzl...@gmail.com
 An: users@wicket.apache.org
 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 andre-p...@gmx.de
 
  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 schuetz.an...@gmx.net
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 

-- 
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: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Multi Tab and Session

2012-02-29 Thread Dan Retzlaff
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.) 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 andre-p...@gmx.de

 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 dretzl...@gmail.com
  An: users@wicket.apache.org
  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 andre-p...@gmx.de
 
   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 schuetz.an...@gmx.net
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  

 --
 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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Multi Tab and Session

2012-02-29 Thread Andre Schütz
Hi,

I could identify the cause of the problem, but still have no
solution.

I set some breakpoints and made some output messages to trace
the system. The following thinks happened:

(1)
I submit a search in Tab1. The search word will be passed as 
Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
search in Tab2. Tab2 switches to its Page2 and the loading animation
stops in both Tabs.

Reason:
-- The constructors of Page2 is called twice on the two Tabs.

As diagram:
01.) Tab1: Page1 submit search
02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
03.) Tab1: shows loading animation with its AjaxSelfUpdatingTimerBehavior at 
PanelA
04.) Tab2: Page1 submit search
05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
06.) Tab2: shows loading animation with its AjaxSelfUpdatingTimerBehavior at 
PanelA
07.) Tab1: Page2 (Page id = 17) calls its constructor
08.) Tab1: does not update anymore
09.) Tab2: Page2 (Page id = 18) calls its constructor
10.) Tab2: does not update anymore

I do nothing from the beginning of step 7 and do not know why the constructor
is called again.

(2)
The same odd behavior happens, when I do the following. I submit a search
in Tab1 from its Page1. While the loading animation is shown, I reload the
Page1 in Tab2. The constructor of Page2 in Tab1 is called again and the 
Page2 in Tab1 stops its update progress.

As diagram:
01.) Tab1: Page1 submit search
02.) Tab1: Page2 (Page id = 22) calls its constructor and adds a PanelA
03.) Tab1: shows loading animation with its AjaxSelfUpdatingTimerBehavior at 
PanelA
04.) Tab2: Reload any Page
05.) Tab1: Page2 (Page id = 23) calls its constructor
06.) Tab1: does not update anymore


I really can't explain to myself, why the constructor is called again. But I 
think
that this second call in the individual Tabs is crashing my application.
Any ideas about this odd behavior?

Thank in advance,
Andre


On Wed, 29 Feb 2012 10:10:37 -0800
Dan Retzlaff dretzl...@gmail.com 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.) 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 andre-p...@gmx.de
 
  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 dretzl...@gmail.com
   An: users@wicket.apache.org
   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 andre-p...@gmx.de
  
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

Re: Multi Tab and Session

2012-02-29 Thread Martin Grigorov
On Wed, Feb 29, 2012 at 8:10 PM, Dan Retzlaff dretzl...@gmail.com 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 andre-p...@gmx.de

 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 dretzl...@gmail.com
  An: users@wicket.apache.org
  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 andre-p...@gmx.de
 
   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 schuetz.an...@gmx.net
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional commands, e-mail: users-h...@wicket.apache.org
  
  

 --
 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: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





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

-
To unsubscribe, e

Re: Multi Tab and Session

2012-02-29 Thread Martin Grigorov
2012/2/29 Andre Schütz andre-p...@gmx.de:
 Hi,

 I could identify the cause of the problem, but still have no
 solution.

 I set some breakpoints and made some output messages to trace
 the system. The following thinks happened:

 (1)
 I submit a search in Tab1. The search word will be passed as
 Page Parameter to Page2 in Tab1. While Tab1 is showing the loading
 animation with it AjaxSelfUpdatingTimerBehavior, I submit a second
 search in Tab2. Tab2 switches to its Page2 and the loading animation
 stops in both Tabs.

 Reason:
 -- The constructors of Page2 is called twice on the two Tabs.

 As diagram:
 01.) Tab1: Page1 submit search
 02.) Tab1: Page2 (Page id = 14) calls its constructor and adds a PanelA
 03.) Tab1: shows loading animation with its AjaxSelfUpdatingTimerBehavior at 
 PanelA
 04.) Tab2: Page1 submit search
 05.) Tab2: Page2 (Page id = 16) calls its constructor and adds a PanelA
 06.) Tab2: shows loading animation with its AjaxSelfUpdatingTimerBehavior at 
 PanelA
 07.) Tab1: Page2 (Page id = 17) calls its constructor
 08.) Tab1: does not update anymore
 09.) Tab2: Page2 (Page id = 18) calls its constructor
 10.) Tab2: does not update anymore

 I do nothing from the beginning of step 7 and do not know why the constructor
 is called again.

Put a breakpoint in Page2 constructor and see why it is called.


 (2)
 The same odd behavior happens, when I do the following. I submit a search
 in Tab1 from its Page1. While the loading animation is shown, I reload the
 Page1 in Tab2. The constructor of Page2 in Tab1 is called again and the
 Page2 in Tab1 stops its update progress.

 As diagram:
 01.) Tab1: Page1 submit search
 02.) Tab1: Page2 (Page id = 22) calls its constructor and adds a PanelA
 03.) Tab1: shows loading animation with its AjaxSelfUpdatingTimerBehavior at 
 PanelA
 04.) Tab2: Reload any Page
 05.) Tab1: Page2 (Page id = 23) calls its constructor
 06.) Tab1: does not update anymore


 I really can't explain to myself, why the constructor is called again. But I 
 think
 that this second call in the individual Tabs is crashing my application.
 Any ideas about this odd behavior?

 Thank in advance,
 Andre


 On Wed, 29 Feb 2012 10:10:37 -0800
 Dan Retzlaff dretzl...@gmail.com 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.) 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 andre-p...@gmx.de

  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 dretzl...@gmail.com
   An: users@wicket.apache.org
   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 andre-p...@gmx.de
  
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

Multi Tab and Session

2012-02-28 Thread Andre Schütz
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 schuetz.an...@gmx.net

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Multi Tab and Session

2012-02-28 Thread Dan Retzlaff
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 andre-p...@gmx.de

 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 schuetz.an...@gmx.net

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Multi Tab and Session

2012-02-28 Thread Martin Grigorov
Hi,

2012/2/29 Andre Schütz andre-p...@gmx.de:
 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.

Same session - yes.
Same behavior instance - no. You can verify that with a breakpoint in
#onTimer() method and checking 'this'.


 Can anybody help me with that problem? Would be great.

 --
 Andre Schütz schuetz.an...@gmx.net

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




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

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org