Problems with wicket-select2 and session timeout

2014-04-02 Thread Tom Götz
Hello everyone,

I already posted this on https://github.com/ivaynberg/wicket-select2/issues/83 
but thought I could mention it here also, as I’m not sure yet if the described 
problem is related to wicket-select2 or Wicket itself:

if my current session is already expired and I click a Select2Choice, Wicket 
creates an ajax response containing a redirect (see here: 
http://bit.ly/1flepiM) but this response is never digestet by 
wicket-ajax-jquery.js, because it is not even loaded on the current page (no 
ajax components/behaviors). Even if there are other ajax components on the page 
and wicket-ajax-jquery.js is loaded, processAjaxResponse is never called. The 
result is that the redirect is not happening and the select2 gets stuck (like 
this: http://bit.ly/1fligwv).

I created a quickstart to demonstrate this: http://bit.ly/1flfQOc (the session 
timeout is set to 1min in web.xml):

- open browser on localhost:8080
- wait for 1min
- click on select2
- look at response in e.g. firebug

Wicket identifies the request as „ajax“ because wicket-select2 sets the 
WebRequest.PARAM_AJAX parameter. If the request is processed correctly, the 
JSON response is returned and digested, but in case of a server-side error 
(e.g. PageExpiredException) the returned ajax response is not consumed 
(wicket-ajax-jquery.js not loaded) , as far as I do understand the code.

Any hints?

Cheers,
   -Tom




Re: Problems with wicket-select2 and session timeout

2014-04-02 Thread Ernesto Reinaldo Barreiro
Hi,

As far as I can see select2 it seems to use jQuery ajax.

1-
https://github.com/ivaynberg/wicket-select2/blob/master/wicket-select2/src/main/java/com/vaynberg/wicket/select2/res/select2.js#L358

So, there is no wicket client side processing of the response. So, what
you see  is correct.



On Wed, Apr 2, 2014 at 8:10 AM, Tom Götz t...@decoded.de wrote:

 Hello everyone,

 I already posted this on
 https://github.com/ivaynberg/wicket-select2/issues/83 but thought I could
 mention it here also, as I'm not sure yet if the described problem is
 related to wicket-select2 or Wicket itself:

 if my current session is already expired and I click a Select2Choice,
 Wicket creates an ajax response containing a redirect (see here:
 http://bit.ly/1flepiM) but this response is never digestet by
 wicket-ajax-jquery.js, because it is not even loaded on the current page
 (no ajax components/behaviors). Even if there are other ajax components on
 the page and wicket-ajax-jquery.js is loaded, processAjaxResponse is never
 called. The result is that the redirect is not happening and the select2
 gets stuck (like this: http://bit.ly/1fligwv).

 I created a quickstart to demonstrate this: http://bit.ly/1flfQOc (the
 session timeout is set to 1min in web.xml):

 - open browser on localhost:8080
 - wait for 1min
 - click on select2
 - look at response in e.g. firebug

 Wicket identifies the request as ajax because wicket-select2 sets the
 WebRequest.PARAM_AJAX parameter. If the request is processed correctly, the
 JSON response is returned and digested, but in case of a server-side error
 (e.g. PageExpiredException) the returned ajax response is not consumed
 (wicket-ajax-jquery.js not loaded) , as far as I do understand the code.

 Any hints?

 Cheers,
-Tom





-- 
Regards - Ernesto Reinaldo Barreiro


Re: Problems with wicket-select2 and session timeout

2014-04-02 Thread Ernesto Reinaldo Barreiro
I think I'm also having this problem...

Locking at the code of

https://github.com/ivaynberg/wicket-select2/blob/master/wicket-select2/src/main/java/com/vaynberg/wicket/select2/res/select2.js#L1312

 I do not see an option to do something different as callback of $.ajax...
Unless we try to use

https://github.com/ivaynberg/wicket-select2/blob/master/wicket-select2/src/main/java/com/vaynberg/wicket/select2/res/select2.js#L1324

?



On Wed, Apr 2, 2014 at 9:44 AM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,

 As far as I can see select2 it seems to use jQuery ajax.

 1-
 https://github.com/ivaynberg/wicket-select2/blob/master/wicket-select2/src/main/java/com/vaynberg/wicket/select2/res/select2.js#L358

 So, there is no wicket client side processing of the response. So, what
 you see  is correct.



 On Wed, Apr 2, 2014 at 8:10 AM, Tom Götz t...@decoded.de wrote:

 Hello everyone,

 I already posted this on
 https://github.com/ivaynberg/wicket-select2/issues/83 but thought I
 could mention it here also, as I'm not sure yet if the described problem is
 related to wicket-select2 or Wicket itself:

 if my current session is already expired and I click a Select2Choice,
 Wicket creates an ajax response containing a redirect (see here:
 http://bit.ly/1flepiM) but this response is never digestet by
 wicket-ajax-jquery.js, because it is not even loaded on the current page
 (no ajax components/behaviors). Even if there are other ajax components on
 the page and wicket-ajax-jquery.js is loaded, processAjaxResponse is never
 called. The result is that the redirect is not happening and the select2
 gets stuck (like this: http://bit.ly/1fligwv).

 I created a quickstart to demonstrate this: http://bit.ly/1flfQOc (the
 session timeout is set to 1min in web.xml):

 - open browser on localhost:8080
 - wait for 1min
 - click on select2
 - look at response in e.g. firebug

 Wicket identifies the request as ajax because wicket-select2 sets the
 WebRequest.PARAM_AJAX parameter. If the request is processed correctly, the
 JSON response is returned and digested, but in case of a server-side error
 (e.g. PageExpiredException) the returned ajax response is not consumed
 (wicket-ajax-jquery.js not loaded) , as far as I do understand the code.

 Any hints?

 Cheers,
-Tom





 --
 Regards - Ernesto Reinaldo Barreiro




-- 
Regards - Ernesto Reinaldo Barreiro