I have an async-thread running that is periodically checking a database for an insert to occur. When the record is found, the UI is then loaded.
The UI.push() method works correctly when a large amount of data is loaded and significant UI changes have occured. Where I am having issues, is when pushing a Label.setValue() change back to the client.
The code for the update to the Label is:
Label displayProgress;
...
private void updateProgress(final int status) {
CustomUI.getInstance().access(new Runnable() {
@Override
public void run() {
LOG.log(Level.INFO, "Running progress text update");
StringBuilder sb = new StringBuilder(100);
String desc = StateManager.getDescription(status);
Integer step = StateManager.getStatusIndex(status);
sb.append("Step ").append(step).append(" of ").append(StateManager.getStatusCount());
sb.append("\n").append(desc);
displayProgress.setValue(sb.toString());
//displayProgress.markAsDirty();
LOG.log(Level.INFO, sb.insert(0, "Progress text should be: ").toString());
CustomUI.getInstance().push();
}
});
}
My CustomUI class has the following annotation added:
@Push(value = PushMode.MANUAL, transport = Transport.STREAMING)
This code is called ~10 secs inside the async-thread. The logging shows the correct outputs I am expecting, however the Label will never display. The label is viewable to the client if working correctly.
Other implementations I have tried, with no success:
- Using UI.setPollInterval(10000)
- Push transport values of STREAMING and WEBSOCKET
- Other displayable components inplace of Label
- Manually marking display component as dirty
- Component.Immediate values of true and false
The server I am using is Apache Tomcat/7.0.42 with JVM 1.6. I am unable to change or update anything on the server so I am limited to modifing only application settings and project files to solve this problem. Hopefully somebody else has solved this issue already and can help me out.
Thanks