|Re: updating table from server push in RAP [message #126820 is a reply to message #126808]
||Wed, 01 April 2009 20:54
| Austin Riddle
Registered: July 2009
Hi Tom, |
Without understanding your situation, here are two considerations to keep
in mind for "pushing" information from the server:
1. The only normal way that something can get back to the client-side is
through the request life-cycle.
2. You must have a reference to the Display that belongs to the client you
are trying to "push" something to.
The idea of "pushing" something to the clients is sort of a misnomer,
since the request life-cycle only occurs when the user does something, or
while you have a UI callback active. We have a dirty little trick in our
initiate the life-cycle at an interval) because we found that the
UICallback mechanism was not adequate in our situation. With any of these
means you can push information to a display from application scope.
Now, in terms of updating clients, another dirty trick is to register
listeners from session scope on the data you are interested in as OSGi
services. Then when the data is changed, all of the listeners will be
notified. If those listeners have a reference to the display for that
client then the UI can be updated. Just make sure that when your app is
disposed, that those listeners are unregistered.
There are some issues with this approach (I am sure the RAP guys are
rolling their eyes right now) :). But it is perfectly viable in certain
Anyway, hope this helps.
Powered by FUDForum
. Page generated in 0.02718 seconds