Package org.apache.syncope.console.wicket.ajax.markup.html

Examples of org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton


        final CrontabContainer crontab = new CrontabContainer("crontab", new PropertyModel<String>(reportTO,
                "cronExpression"), reportTO.getCronExpression());
        form.add(crontab);

        final AjaxButton submit =
                new ClearIndicatingAjaxButton(APPLY, new ResourceModel(APPLY), getPageReference()) {

                    private static final long serialVersionUID = -958724007591692537L;

                    @Override
                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
                        ReportTO toSubmit = (ReportTO) form.getModelObject();
                        toSubmit.setCronExpression(StringUtils.hasText(toSubmit.getCronExpression())
                                ? crontab.getCronExpression()
                                : null);

                        try {
                            if (toSubmit.getId() > 0) {
                                reportRestClient.update(toSubmit);
                            } else {
                                reportRestClient.create(toSubmit);
                            }

                            ((BasePage) callerPageRef.getPage()).setModalResult(true);

                            window.close(target);
                        } catch (SyncopeClientException e) {
                            LOG.error("While creating or updating report", e);
                            error(getString(Constants.ERROR) + ": " + e.getMessage());
                            feedbackPanel.refresh(target);
                        }
                    }

                    @Override
                    protected void onError(final AjaxRequestTarget target, final Form<?> form) {
                        feedbackPanel.refresh(target);
                    }
                };

        if (reportTO.getId() > 0) {
            MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
                    xmlRolesReader.getAllAllowedRoles("Reports", "update"));
        } else {
            MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
                    xmlRolesReader.getAllAllowedRoles("Reports", "create"));
        }

        form.add(submit);

        final AjaxButton cancel =
                new ClearIndicatingAjaxButton(CANCEL, new ResourceModel(CANCEL), getPageReference()) {

                    private static final long serialVersionUID = -958724007591692537L;

                    @Override
                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
                        window.close(target);
                    }
                };

        cancel.setDefaultFormProcessing(false);
        form.add(cancel);
    }
View Full Code Here


                confirm.setEnabled(changepwd.getModelObject());
                target.add(pwdMgt);
            }
        });

        cancel = new ClearIndicatingAjaxButton("cancel", new ResourceModel("cancel"), pageRef) {

            private static final long serialVersionUID = -2341391430136818026L;

            @Override
            protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
                // ignore
                window.close(target);
            }
        }.feedbackPanelAutomaticReload(false);

        pwdMgtForm.add(cancel);

        final ClearIndicatingAjaxButton goon =
                new ClearIndicatingAjaxButton("continue", new ResourceModel("continue"), pageRef) {

                    private static final long serialVersionUID = -2341391430136818027L;

                    @Override
                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
View Full Code Here

    private void passwordManagement(
            final AjaxRequestTarget target,
            final ResourceAssociationActionType type,
            final Collection<StatusBean> selection) {

        final ClearIndicatingAjaxButton goon =
                new ClearIndicatingAjaxButton("continue", new ResourceModel("continue", "Continue"), pageRef) {

                    private static final long serialVersionUID = -2341391430136818027L;

                    @Override
                    protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
View Full Code Here

TOP

Related Classes of org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.