Search in sources :

Example 1 with BasePanel

use of com.evolveum.midpoint.gui.api.component.BasePanel in project midpoint by Evolveum.

the class FutureUpdateBehavior method onTimer.

@Override
protected void onTimer(final AjaxRequestTarget target) {
    if (future == null || !future.isDone()) {
        return;
    }
    try {
        T data = future.get();
        Component component = getComponent();
        if (component instanceof BasePanel) {
            BasePanel<T> panel = (BasePanel<T>) component;
            panel.getModel().setObject(data);
        } else {
            if (component.getDefaultModel() == null) {
                component.setDefaultModel(new Model());
            }
            component.setDefaultModelObject(data);
        }
        stop(target);
        onPostSuccess(target);
    } catch (InterruptedException ex) {
        handleError(ex, target);
    } catch (ExecutionException ex) {
        handleError(ex, target);
    }
}
Also used : BasePanel(com.evolveum.midpoint.gui.api.component.BasePanel) Model(org.apache.wicket.model.Model) Component(org.apache.wicket.Component) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)1 ExecutionException (java.util.concurrent.ExecutionException)1 Component (org.apache.wicket.Component)1 Model (org.apache.wicket.model.Model)1