Package org.apache.tapestry.valid

Examples of org.apache.tapestry.valid.IValidationDelegate


            // Deleting things screws up the validation delegate.
            // That's because the errors are associated with the form name
            // (not the component id), and deleting elements causes
            // all the names to shift.

            IValidationDelegate delegate = (IValidationDelegate) getBeans().getBean("delegate");

            delegate.clear();
        }
    }
View Full Code Here


    public void formSubmit(IRequestCycle cycle)
    {
        if (Tapestry.isBlank(file.getFileName()))
        {
            IValidationDelegate delegate = (IValidationDelegate) getBeans().getBean("delegate");

            delegate.setFormComponent((IFormComponent) getComponent("inputFile"));
            delegate.record("You must specify a file to upload.", ValidationConstraint.REQUIRED);
            return;
        }

        UploadResults results = (UploadResults) cycle.getPage("UploadResults");
View Full Code Here

        return (IValidationDelegate) getBeans().getBean("delegate");
    }

    private void setErrorField(String componentId, String message)
    {
        IValidationDelegate delegate = getValidationDelegate();
        IFormComponent field = (IFormComponent) getComponent(componentId);

        delegate.setFormComponent(field);
        delegate.record(message, null);
    }
View Full Code Here

        delegate.record(message, null);
    }

    private void clear(String componentId)
    {
        IValidationDelegate delegate = getValidationDelegate();
        IFormComponent component = (IFormComponent) getComponent(componentId);

        delegate.setFormComponent(component);
        delegate.recordFieldInputValue(null);
    }
View Full Code Here

        delegate.recordFieldInputValue(null);
    }

    public void attemptRegister(IRequestCycle cycle)
    {
        IValidationDelegate delegate = getValidationDelegate();

        String password1 = getPassword1();
        String password2 = getPassword2();

        setPassword1(null);
        setPassword2(null);

        clear("inputPassword1");
        clear("inputPassword2");

        if (delegate.getHasErrors())
            return;
        // Note: we know password1 and password2 are not null
        // because they are required fields.

        if (!password1.equals(password2))
View Full Code Here

    protected void setErrorField(String componentId, String message)
    {
        IFormComponent field = (IFormComponent) getComponent(componentId);

        IValidationDelegate delegate = getValidationDelegate();
        delegate.setFormComponent(field);
        delegate.record(new ValidatorException(message));
    }
View Full Code Here

        String password = getPassword();

        // Do a little extra work to clear out the password.

        setPassword(null);
        IValidationDelegate delegate = getValidationDelegate();

        delegate.setFormComponent((IFormComponent) getComponent("inputPassword"));
        delegate.recordFieldInputValue(null);

        // An error, from a validation field, may already have occured.

        if (delegate.getHasErrors())
            return;

        VirtualLibraryEngine vengine = (VirtualLibraryEngine) getEngine();

        int i = 0;
View Full Code Here

        String password2 = getPassword2();

        setPassword1(null);
        setPassword2(null);

        IValidationDelegate delegate = getValidationDelegate();

        delegate.setFormComponent((IFormComponent) getComponent("inputPassword1"));
        delegate.recordFieldInputValue(null);

        delegate.setFormComponent((IFormComponent) getComponent("inputPassword2"));
        delegate.recordFieldInputValue(null);

        if (delegate.getHasErrors())
            return;

        Map attributes = getAttributes();

        if (Tapestry.isBlank(password1) != Tapestry.isBlank(password2))
View Full Code Here

    protected void setErrorField(String componentId, String message)
    {
        IFormComponent component = (IFormComponent) getComponent(componentId);

        IValidationDelegate delegate = getValidationDelegate();

        delegate.setFormComponent(component);
        delegate.record(message, null);
    }
View Full Code Here

        PageRenderSupport prs = newMock(PageRenderSupport.class);

        TranslatedFieldSupport translator = newMock(TranslatedFieldSupport.class);
        ValidatableFieldSupport validator = newMock(ValidatableFieldSupport.class);

        IValidationDelegate delegate = new ValidationDelegate();
        IForm form = newMock(IForm.class);
        IMarkupWriter writer = newBufferWriter();

        Suggest comp = newInstance(Suggest.class,
                                   "response", resp,
View Full Code Here

TOP

Related Classes of org.apache.tapestry.valid.IValidationDelegate

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.