Update UI (@Push) from Quartz JobListener

Hello all,

is it possible to update the UI when Quartz is firing an event?
I want to build a status page so the user can see if a Job is currently running or had an error the previous run.

The JobView implements the JobListener interface, iterates over all Jobs and Displays a component (name, nextFireTime, …).
Now I want to update the custom Component (CssLayout) to show if the job is currently running by calling the update(statusCode) function for the component from the jobToBeExecuted Listener.

Now I can’t call UI.getCurrent().access(new Runnable() { … }); in the update function because I get a NullPointerException (UI is null)

Any help would be appreciated.

Thanks

You can call access when you give the UI instance e.g. as an constructor param to the Class where the update function is in.
UI.getCurrent doesn´t work from background threads.

Hope this helps

Hello,

thanks, defining a UI Class Variable and giving it to the update(status, currentUI) function did work.

Thanks!