Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Wrong UI Thread
Wrong UI Thread [message #84049] Tue, 22 April 2008 11:57 Go to next message
Eclipse UserFriend
Hi ,
I Have problems with UI Thread and other threads, "I guess". my case is
like this:
* I have a shell with a Form, and inside this form there is a table.
* The table data should be updated Constantly by a Thread "SenderThread /
it is a java class implements Runnable interface". This Thread is started
by Search Action Class.
* within the shell there is a method "AddData" that has
getDisplay().asyncExec(new Runnable() { , and responsible to recieve the
updated Data from the Thread "SenderThread".
*Also the shell window, has a some text fields and button for search
action,So when the user click on the button the Search Action will be
activated, and "SenderThread" will start operate.
* SenderThread Class should first change the visibilty of progressBar to
true , then start collecting data ,update the progressBas with progress
then update the table with the collected data
"MyShellWindow.AddData(List), Lastly stop the progressbar.
**** My problem is:
1: My data on table is not updated by SenderThread , when I
click of serch button to start SenderThread operations

2: When i debug the program, the MyShell instance within
SenderThread Class shows a value with "WrongThread".

3: the progressBar is not operate as suppose to, it dont stop
and start as supposed

4: When I click of serch button to start SenderThread
operations, and then press on any other buttons i have on
my
Shell, or write some text on my text field ,,,I get every
things work fine as my table get updated and progress bar
start and progress corectly.


Any suggestion to solve the problem

Regards
Salwa
Re: Wrong UI Thread [message #84066 is a reply to message #84049] Tue, 22 April 2008 12:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi Salwa,

that sounds very much like you haven't enabled asynchronous
UI-Callbacks. See the javadoc of UICallBack#activate() or previous posts
for more information.

Regards,
Stefan.

Salwa schrieb:
> Hi , I Have problems with UI Thread and other threads, "I guess". my
> case is like this:
> * I have a shell with a Form, and inside this form there is a table.
> * The table data should be updated Constantly by a Thread "SenderThread
> / it is a java class implements Runnable interface". This Thread is
> started by Search Action Class. * within the shell there is a method
> "AddData" that has getDisplay().asyncExec(new Runnable() { , and
> responsible to recieve the updated Data from the Thread "SenderThread".
> *Also the shell window, has a some text fields and button for search
> action,So when the user click on the button the Search Action will be
> activated, and "SenderThread" will start operate.
> * SenderThread Class should first change the visibilty of progressBar to
> true , then start collecting data ,update the progressBas with progress
> then update the table with the collected data
> "MyShellWindow.AddData(List), Lastly stop the progressbar.
> **** My problem is:
> 1: My data on table is not updated by SenderThread , when I
> click of serch button to start SenderThread operations
> 2: When i debug the program, the MyShell instance within
> SenderThread Class shows a value with "WrongThread".
>
> 3: the progressBar is not operate as suppose to, it dont
> stop and start as supposed
>
> 4: When I click of serch button to start SenderThread
> operations, and then press on any other buttons i have on
> my Shell, or write some text on my text field ,,,I get every
> things work fine as my table get updated and progress bar
> start and progress corectly.
>
> Any suggestion to solve the problem
>
> Regards Salwa
>
>
>
Re: Wrong UI Thread [message #84095 is a reply to message #84066] Tue, 22 April 2008 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Thankx Alot ,, it works,,
But, Should i disactivate the call back?. Why am asking this:
bcz i have 6 methods have getDisplay().asyncExec(new Runnable() {
and all of them updated from the same Thread from server side... So
should i disactivate the UICallBack in all of them...

Regards
Salwa
Re: Wrong UI Thread [message #84261 is a reply to message #84095] Wed, 23 April 2008 07:43 Go to previous messageGo to next message
Eclipse UserFriend
Hi Salwa,

it should be ok to enable the callback once and disable it if no longer
needed or on application shut-down. You may want to take a look at
org.eclipse.rap.demo.controls.ProgressBarTab.java for an example.

Regards,
Stefan.

Salwa schrieb:
> Thankx Alot ,, it works,,
> But, Should i disactivate the call back?. Why am asking this:
> bcz i have 6 methods have getDisplay().asyncExec(new Runnable() {
> and all of them updated from the same Thread from server side... So
> should i disactivate the UICallBack in all of them...
>
> Regards Salwa
>
Re: Wrong UI Thread [message #84276 is a reply to message #84261] Wed, 23 April 2008 09:51 Go to previous message
Eclipse UserFriend
thankx alot for your help

Regards
salwa
Previous Topic:rap 1m3 - problem after cleaning browser internals
Next Topic:theme variants not working on Text and Composite
Goto Forum:
  


Current Time: Sun Aug 31 03:14:56 EDT 2025

Powered by FUDForum. Page generated in 0.04231 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top