@Override protected void onError(final AjaxRequestTarget target) { notificationPanel.refresh(target); }
@Override @SuppressWarnings("unchecked") public IModel<List<FeedbackMessage>> getModel() { return (IModel<List<FeedbackMessage>>) this.getDefaultModel(); }
@Override @SuppressWarnings("unchecked") public List<FeedbackMessage> getModelObject() { return (List<FeedbackMessage>) this.getDefaultModelObject(); } }
notificationPanel = new NotificationPanel(Constants.FEEDBACK); body.addOrReplace(notificationPanel.setOutputMarkupId(true));
setStatelessHint(true); notificationPanel = new NotificationPanel(Constants.FEEDBACK); add(notificationPanel);
@Override public NotificationPanel setModel(final IModel<List<FeedbackMessage>> model) { this.setDefaultModel(model); return this; }
@Override public NotificationPanel setModelObject(final List<FeedbackMessage> object) { this.setDefaultModelObject(object); return this; }
public NotificationPanel(final String id) { super(id); final Options options = new Options(); options.set("appendTo", "'#appendto'"); options.set("stacking", "'up'"); options.set("templates", "[ { type: 'success', template: $('#successTemplate').html() }," + " { type: 'info', template: $('#successTemplate').html() }," + " { type: 'error', template: $('#errorTemplate').html() }," + " { type: 'warning', template: $('#warningTemplate').html() } ] "); notification = new Notification(Constants.FEEDBACK, options) { private static final long serialVersionUID = 785830249476640904L; @Override public StyledNotificationBehavior newWidgetBehavior(final String selector) { return new StyledNotificationBehavior(selector, options); } }; add(notification); }
public final void refresh(final IPartialPageRequestHandler handler) { this.getModelObject().forEach(message -> { if (message.isError()) { this.notification.error(handler, message.getMessage()); } else if (message.isWarning()) { // this is necessary before check for success and info in order to show warnings: isSuccess and isInfo // return true also in case of warnings ... this.notification.warn(handler, message.getMessage()); } else if (message.isSuccess() || message.isInfo()) { this.notification.success(handler, message.getMessage()); } else { this.notification.warn(handler, message.getMessage()); } message.markRendered(); }); }
public MustChangePassword(final PageParameters parameters) { super(parameters); final NotificationPanel notificationPanel = new NotificationPanel(Constants.FEEDBACK); add(notificationPanel);
@Override protected void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } });
@Override protected void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } });
@Override protected void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } });
@Override protected void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); }
@Override public void onSubmit(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); }
@Override public void onError(final AjaxRequestTarget target) { ((BasePage) getPage()).getNotificationPanel().refresh(target); }
@Override public void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); }
@Override protected void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } });
@Override protected void onError(final AjaxRequestTarget target) { ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } });
@Override public void onClick(final AjaxRequestTarget target) { try { connectorRestClient.reload(); SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED)); } catch (Exception e) { LOG.error("While reloading all connectors", e); SyncopeConsoleSession.get().error( StringUtils.isBlank(e.getMessage()) ? e.getClass().getName() : e.getMessage()); } ((BasePage) pageRef.getPage()).getNotificationPanel().refresh(target); } };