Refreshing my Notification panel's model

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Refreshing my Notification panel's model

Sandor Feher
Hi,

Tightly coupled with my previous topic I'm looking for  a proper solution for refreshing my panel's model and show if it must be showed.

In a nutshell I have a hibernate entity which handled a spring bean which injected into my wicket app.
There is a notification panel which shows some messages to the users. At the moment I refresh this panel using AjaxSelfUpdatingBehaviour. This method besides costly but ruins my session timeout value too (my idle session never expires).

I need a solution to check new messages using my spring bean and notify my panel to refresh and show the messages.

TIA, Sandor


Reply | Threaded
Open this post in threaded view
|

Re: Refreshing my Notification panel's model

Martin Grigorov-4
Hi,

If you use polling (with AjaxSelfUpdatingBehavior) then you refresh the
session with every http request.
You can use WebSocket instead. WebSocket connections do not affect the
session lifetime and you can just push a message from the server side once
there is something for the client.

Another solution is to use what Martin Spielmann suggested in the other
thread - invalidate the session yourself when it is just that ajax behavior.
To do it you need to override #updateAjaxAttributes() for this behavior and
add extra request parameter.
Then with IRequestCycleListener you can intercept all requests and if there
is no other request for N seconds then invalidate the session.
You will recognize this behavior's requests by this special extra parameter.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Sep 22, 2016 at 3:29 PM, Sandor Feher <[hidden email]> wrote:

> Hi,
>
> Tightly coupled with  my previous topic
> <http://apache-wicket.1842946.n4.nabble.com/Handling-
> session-timeout-properly-tp4675541.html>
> I'm looking for  a proper solution for refreshing my panel's model and show
> if it must be showed.
>
> In a nutshell I have a hibernate entity which handled a spring bean which
> injected into my wicket app.
> There is a notification panel which shows some messages to the users. At
> the
> moment I refresh this panel using AjaxSelfUpdatingBehaviour. This method
> besides costly but ruins my session timeout value too (my idle session
> never
> expires).
>
> I need a solution to check new messages using my spring bean and notify my
> panel to refresh and show the messages.
>
> TIA, Sandor
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Refreshing-my-Notification-panel-s-model-tp4675548.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Refreshing my Notification panel's model

Sandor Feher
Hi Martin,

#updateAjaxAttributes() is neat solution works like a charm.
Thank you!!

Sandor