GWTEventService listener triggers additional call each time the web application is displayed in the browser

59 views
Skip to first unread message

gshepherd

unread,
Jul 24, 2012, 4:58:13 PM7/24/12
to google-we...@googlegroups.com
I have a web service bundled with my GWT app and I'm using GWTEventService 1.1.1.  I need for the client to be notified when a record is added to the database via a web service call.  In the OnMonduleLoad I've added the event listener and everything works as expected.  For example, an external call comes into my web service to add a new user.  My listener gets triggered on this event and updates the GUI accordingly.
 
The problem occurs when I leave the URL of my application and then return sometime later, every time I get a new web service request to add a user my listener fires twice.  If I leave the URL again and return now it fires three times and so on.  I've verified that I'm only adding the one listener on startup, but I don't understand why my listener keeps triggering additional times each time I leave my URL and return later.
 
Any ideas would be greatly appreciated.  Thanks.

Andrea Boscolo

unread,
Jul 25, 2012, 8:12:15 AM7/25/12
to google-we...@googlegroups.com
Has been a while since I used the framework, but I suspect you do not 'unlisten' events when you leave your application (see http://code.google.com/p/gwteventservice/wiki/ConnectionHandling), your session stays open and every time you reload the app a new listener is registered.
Anyway I'd suggest to update to GWTEventService 1.2 (much more recent) and ask directly in the project's group https://groups.google.com/forum/?fromgroups#!forum/gwteventservice
Reply all
Reply to author
Forward
0 new messages