Package org.jboss.ballroom.client.widgets.forms

Examples of org.jboss.ballroom.client.widgets.forms.FormValidation


                // save

                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if(!validation.hasErrors())
                        {
                            ConnectionDefinition connectionDef = form.getUpdatedEntity();
                            connectionDef.setApplication(true); // JBPAPP-9977: reasonable default
                            parent.onCompleteStep1(connectionDef);
                        }
View Full Code Here


                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        // merge base

                        FormValidation validation = form.validate();
                        if(validation.hasErrors())
                            return;

                        presenter.onCreateProtocol(form.getUpdatedEntity());

                    }
View Full Code Here

        ToolStrip toolstrip = new ToolStrip();

        ToolButton addBtn = new ToolButton(Console.CONSTANTS.common_label_append(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                FormValidation validation = form.validate();
                if(!validation.hasErrors())
                {
                    errorMessages.setVisible(false);
                    JGroupsProtocol protocol = form.getUpdatedEntity();
                    dataProvider.getList().add(protocol);
                    table.getSelectionModel().setSelected(protocol, true);
View Full Code Here

            new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {

                    FormValidation validation = form.validate();
                    if(!validation.hasErrors())
                        presenter.onCreateTopic(form.getUpdatedEntity());
                }
            },
             new ClickHandler() {
View Full Code Here

        VerticalPanel panel = new VerticalPanel();
        panel.setStyleName("fill-layout");
        form = new Form<PoolConfig>(PoolConfig.class) {
          @Override
          public FormValidation validate() {
            FormValidation superValidation = super.validate();
                PoolConfig updatedEntity = this.getUpdatedEntity();
                int minPoolSize = updatedEntity.getMinPoolSize();
            int maxPoolSize = updatedEntity.getMaxPoolSize();
            if(minPoolSize > maxPoolSize){
              superValidation.addError("maxPoolSize");
              maxCon.setErroneous(true);
              maxCon.setErrMessage("Max Pool Size must be greater than Min Pool Size");
            }
            return superValidation;
          }
View Full Code Here

                new ClickHandler() {

                    @Override
                    public void onClick(ClickEvent event) {

                        FormValidation validation = form.validate();
                        if(!validation.hasErrors())
                            presenter.onCreateConnector(form.getUpdatedEntity());
                    }
                },
                new ClickHandler() {
View Full Code Here

        ClickHandler submitHandler = new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {

                FormValidation validation = form.validate();
                if (!validation.hasErrors()) {
                    // proceed
                    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {

                        @Override
                        public void execute() {
View Full Code Here

            new ClickHandler() {

                @Override
                public void onClick(ClickEvent event) {

                    FormValidation validation = form.validate();
                    if(!validation.hasErrors())
                        presenter.onCreateQueue(form.getUpdatedEntity());
                }
            },
             new ClickHandler() {
View Full Code Here

        this.numColumns = i;
    }


    public FormValidation validate() {
        FormValidation outcome = new FormValidation();

        for(FormItem item : items)
        {
            // two cases: empty form (create entity) and updating an existing entity
            // we basically force validation on newly created entities
            boolean requiresValidation = item.isModified();

            if(requiresValidation)
            {
                Object value = item.getValue();

                // ascii or empty string are ok. the later will be checked in each form item implentation.
                String stringValue = String.valueOf(value);
                boolean ascii = stringValue.isEmpty() ||
                        stringValue.matches("^[\\u0020-\\u007e]+$");

                if(!ascii)
                {
                    outcome.addError(item.getName());
                    item.setErroneous(true);
                }
                else
                {
                    boolean validValue = item.validate(value);
                    if(validValue)
                    {
                        item.setErroneous(false);
                    }
                    else
                    {
                        outcome.addError(item.getName());
                        item.setErroneous(true);
                    }
                }
            }
        }
View Full Code Here

        }
    }

    @Override
    public FormValidation validate() {
        FormValidation formValidation = new FormValidation();
        for (FormAdapter<T> form : forms.values()) {
            FormValidation tabValidation = form.validate();
            for (String error : tabValidation.getErrors()) {
                formValidation.addError(error);
            }
        }
        return formValidation;
    }
View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.widgets.forms.FormValidation

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.