Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 318185

Summary: TableViewer does not refresh
Product: [RT] RAP Reporter: Christian Schwarz <chriss.dev>
Component: JFaceAssignee: Project Inbox <rap-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: major    
Priority: P3    
Version: 1.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
2 test projects none

Description Christian Schwarz CLA 2010-06-28 10:29:22 EDT
Build Identifier: 

The TableViewer refresh does not work. A refresh will be performed if the row that needs an update is clicked. 

may be -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=205101 needs to be reopended

Reproducible: Always

Steps to Reproduce:
see attachment
Comment 1 Christian Schwarz CLA 2010-06-28 10:31:26 EDT
Created attachment 172910 [details]
2 test projects
Comment 2 Ivan Furnadjiev CLA 2010-06-30 05:14:12 EDT
If I understand correctly, you want to update/refresh the UI (table) from the server side (Job). In this case you have to activate the UICallback first. Something like this:
------
UICallBack.activate( getClass().getSimpleName() );
new WorkbenchJob(parent.getDisplay(), "refresh Table") {
....
}
-----
Please reopen if disagree.
Comment 3 Christian Schwarz CLA 2010-06-30 07:17:50 EDT
Okay, thanks ! Now it works fine. 
I wonder why i have never heard of UICallBack.*, is there any documentation that points out why and when it have to be used (the UICallback-APIDoc and google didn't help much) ? It make single sourcing a bit complicated.

Right now it seems to me that #activate(..) must called always, if i want to run something in the UI-Thread. If yes, why isn't it done in every call of Display.syncExec(..) / .asyncExec(..) ? 
Should i call UICallback.deactivate() after the Job is done ?

Thanks and sorry for my bad english
Comment 4 Ivan Furnadjiev CLA 2010-06-30 07:26:41 EDT
Hope this helps:
http://wiki.eclipse.org/RAP/FAQ#How_to_update_the_UI_from_a_background_thread
Comment 5 Christian Schwarz CLA 2010-06-30 09:33:14 EDT
The first sentence of that link is: 
Note: this article only applies if you are not using the Jobs API to do background work.

In the provided test project the Job-API is used, so i think i dont have to use the UICallback-methods at all. The WorkbenchJob is used like in this example: 

http://wiki.eclipse.org/RAP/FAQ#How_to_update_the_UI_from_a_background_thread_using_Jobs.3F

Maybe there is a Bug in the Job-API or the wiki is wrong.
Comment 6 Ivan Furnadjiev CLA 2010-06-30 10:17:16 EDT
Hi Chris, I think that this issue is the same like in this bug 274806 - reschedule the Job inside the Job, outside the request and we can't do much inside the framework. See bug 274806 comment # 16.