Example usage for org.apache.wicket.extensions.wizard WizardButton onError

List of usage examples for org.apache.wicket.extensions.wizard WizardButton onError

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.wizard WizardButton onError.

Prototype

@Override
    public void onError() 

Source Link

Usage

From source file:org.apache.syncope.client.console.wizards.AjaxWizardMgtButtonBar.java

License:Apache License

private void ajaxify(final WizardButton button) {
    button.add(new AjaxFormSubmitBehavior("click") {

        private static final long serialVersionUID = 1L;

        @Override/*from ww  w.j av a 2 s.  c o  m*/
        protected void updateAjaxAttributes(final AjaxRequestAttributes attributes) {
            super.updateAjaxAttributes(attributes);

            AjaxWizardMgtButtonBar.this.updateAjaxAttributes(attributes);
        }

        @Override
        public boolean getDefaultProcessing() {
            return button.getDefaultFormProcessing();
        }

        @Override
        protected void onSubmit(final AjaxRequestTarget target) {
            target.add(findParent(Wizard.class));
            button.onSubmit();
        }

        @Override
        protected void onAfterSubmit(final AjaxRequestTarget target) {
            button.onAfterSubmit();
        }

        @Override
        protected void onError(final AjaxRequestTarget target) {
            target.add(findParent(Wizard.class));
            button.onError();
            ((BasePage) getPage()).getNotificationPanel().refresh(target);
        }

        @Override
        protected void onComponentTag(final ComponentTag tag) {
            tag.put("type", "button");
        }
    });
}