|
Re: Block Mouse/Key Events during server request [message #831745 is a reply to message #831042] |
Thu, 29 March 2012 09:27 |
Tim Buschtoens Messages: 396 Registered: July 2009 |
Senior Member |
|
|
Hi.
Actually, a bug[1] in the current implementation prevents the client
form having more than 1 mouse or selection event queued (in addition to
the running one). Therefore i'm not sure how the effect you describe
could happen. Worst case scenario, you click two times during a running
request, only one click will get send to the server after the request is
finished. Perhaps you should put more research into what exactly
happens, or perhaps i'm understanding it wrong.
In any case, such problems should be solved in RAP 2.0 (this or next
year) with the implementation of the client-to-server protocol. If you
can't wait that long, it gets tricky.
What you want is basically to freeze the entire application during a
request. I can't recommand that (it'll might feel broken), but if you
really want to try it, the easiest way would be to hack the client to
always use synchrounous requests. I can only give you some pointers, you
will have to figure out the details yourself:
In the bundle org.eclipse.rap.rwt, there is a file
js/org/eclipse/swt/Request.js. The method "_sendImmediate" is used for
most requests.
If you overwrite the argument async with false in the first line, it
*might* do what you want. This is very, very hacky, i can't guarantee it
will work, or if you will break anything with that trick.
Also, you need to recompile the client.js[2]. Alternatively, if you have
enough js-know-how, you could try to register some new javascript or use
the javascript-executer to hack the client. Thats even more complicated,
but you wouldn't have to touch the bundle.
Hope that helps.
Greetings,
Tim
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=327887
[2] https://github.com/ralfstx/rap-clientbuilder
Am 28.03.2012 13:39, schrieb Avrajit Chatterjee:
> Hi ,
>
> I know that
> 1. RAP uses a RequestQueue to send requests to server
> 2. Also RAP shows a Progress cursor after 500ms of the request made
> My query -
> At times when the server is slow and a request is being processed, the
> user can do multiple mouse,key activities.Most of them gets queued up
> and the server request is made one by one which makes the UI updates to
> come in a sequential manner and makes our application look ugly. We cant
> make our server faster , neither we can push these requests in
> BG/Eclipse Job threads. So we want to prevent the user from doing any
> operation when a request is being processed. Or even if the user is
> doing mouse clicks we don't want them to be processed. Can we achieve
> this? We are using 1.5M4.
--
Tim Buschtöns
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03907 seconds