Examples of IValidationDelegate


Examples of org.apache.tapestry.valid.IValidationDelegate

                object);
    }

    public Object parse(TranslatedField field, String text) throws ValidatorException
    {
        IValidationDelegate delegate = field.getForm().getDelegate();

        delegate.recordFieldInputValue(text);

        ValidationMessages messages = new ValidationMessagesImpl(field, _threadLocale.getLocale());

        return field.getTranslator().parse(field, messages, text);
    }
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        setForm(form);
       
        if (form.wasPrerendered(writer, this))
            return;
       
        IValidationDelegate delegate = form.getDelegate();
       
        delegate.setFormComponent(this);
       
        setName(form);
       
        if (form.isRewinding())
        {
            if (!isDisabled())
            {
                rewindFormComponent(writer, cycle);
            }
           
            // This is for the benefit of the couple of components (LinkSubmit) that allow a body.
            // The body should render when the component rewinds.
           
            if (getRenderBodyOnRewind())
                renderBody(writer, cycle);
        }
        else if (!cycle.isRewinding())
        {
            if (!NullWriter.class.isInstance(writer))
                form.setFormFieldUpdating(true);
           
            renderFormComponent(writer, cycle);

            if (getCanTakeFocus() && !isDisabled())
            {
                delegate.registerForFocus(
                        this,
                        delegate.isInError() ? ValidationConstants.ERROR_FIELD
                                : ValidationConstants.NORMAL_FIELD);
            }

        }
    }
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        setForm(form);

        if (form.wasPrerendered(writer, this))
            return;

        IValidationDelegate delegate = form.getDelegate();

        delegate.setFormComponent(this);

        form.getElementId(this);

        if (form.isRewinding())
        {
            if (!isDisabled())
            {
                rewindFormComponent(writer, cycle);
            }
        }
        else if (!cycle.isRewinding())
        {
            if (!isDisabled())
                delegate.registerForFocus(this, ValidationConstants.NORMAL_FIELD);

            renderFormComponent(writer, cycle);

            if (delegate.isInError())
                delegate.registerForFocus(this, ValidationConstants.ERROR_FIELD);
        }

        super.renderComponent(writer, cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        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

Examples of org.apache.tapestry.valid.IValidationDelegate

        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

Examples of org.apache.tapestry.valid.IValidationDelegate

        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

Examples of org.apache.tapestry.valid.IValidationDelegate

    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

Examples of org.apache.tapestry.valid.IValidationDelegate

        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

Examples of org.apache.tapestry.valid.IValidationDelegate

        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

Examples of org.apache.tapestry.valid.IValidationDelegate

    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
TOP
Copyright © 2018 www.massapi.com. 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.