How does RAP process UI actions? [message #756696] |
Mon, 14 November 2011 12:21  |
Eclipse User |
|
|
|
Hello RAP team,
just a general question regarding RAP's UI event processing.
When you click on multiple UI elements (e.g. buttons) within a short time, are those clicks processed in a queue, one by one, each one waiting for the previous one to be finished (somehow "synchronized")?
You know, in some cases our application code takes some time to generate a response (e.g. when filtering a list or searching for something in a huge amount of data). During waiting for the UI to respond the user may click again and again or he may want to perform a different action. So we're just curious if the pending requests would get aborted (normal web page behaviour) or not.
It might be even interesting if there is a possibility to disable such a synchronization and abort pending requests in order to make the UI more "responsive".
- Stefan
|
|
|
Re: How does RAP process UI actions? [message #756724 is a reply to message #756696] |
Mon, 14 November 2011 15:04  |
Eclipse User |
|
|
|
Stefan,
As in SWT, all Events are processed in a single UI Thread. In the case of RAP, there is one thread per session. Thus, events are inherently "synchronized". In order to keep the UI responsive, the event handlers in your application code should not be time consuming. If you need to perform a long running operation like you mention, you should use a background thread.
If you are using the Workbench, then the Eclipse Jobs API provides a good framework for this [1][2]. It can provide feedback on progress and allow the user to cancel a previous task.
If you are using just RWT, you will want to create your own background thread for handling the long-running tasks [3].
In either case, your application would handle canceling previous requests based on additional user input.
- Cole
[1] http://www.vogella.de/articles/EclipseJobs/article.html
[2] http://wiki.eclipse.org/RAP/FAQ#How_to_update_the_UI_from_a_background_thread_using_Jobs.3F
[3] http://wiki.eclipse.org/RAP/FAQ#How_to_update_the_UI_from_a_background_thread
|
|
|
Powered by
FUDForum. Page generated in 0.56607 seconds