|
Re: [NEON] Refresh Ui Component instantly [message #1747376 is a reply to message #1746653] |
Mon, 14 November 2016 07:32 |
|
Your guess is almost right. The UI change doesn't happen immediately because you call setText/setEnabled outside of a model job. All changes on the Scout (UI) model must happen inside of a model job. So when you do something in the background by starting an arbitrary Thread you must make sure, that this Thread starts a model thread again, when you call a method on the Scout model (like you do). Instead of the Jobs class, simply use the ModelJobs class. A small example:
// this is executed by a thread != Scout model thread
loadALotOfDataInTheBackground();
// when you're done...
ModelJobs.schedule(new IRunnable() {
@Override
public void run() throws Exception {
m_stringField.setText("I'm done");
}
}, ModelJobs.newInput(ClientRunContexts.copyCurrent()));
You should also check the technical guide for more details about the Scout jobs framework:
https://eclipsescout.github.io/6.0/technical-guide.html#modeljobs
Eclipse Scout Homepage | Documentation | GitHub
|
|
|
|
Powered by
FUDForum. Page generated in 0.03344 seconds