Examples of IValidationDelegate


Examples of org.apache.tapestry.valid.IValidationDelegate

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

        setForm(form);

        IValidationDelegate delegate = form.getDelegate();

        delegate.setFormComponent(this);

        setName(form.getElementId(this));

        if (form.isRewinding())
            handleSubmission(cycle);
View Full Code Here

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

Examples of org.apache.tapestry.valid.IValidationDelegate

    {
        IForm result = TapestryUtils.getForm(cycle, this);

        setForm(result);

        IValidationDelegate delegate = result.getDelegate();

        delegate.setFormComponent(this);

        return result;
    }
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        verifyControls();
    }

    public void testNoField()
    {
        IValidationDelegate delegate = new MockDelegate();
        IForm form = newForm(delegate);
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle(form);

        replayControls();
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        verifyControls();
    }

    public void testDisplayNameFromField()
    {
        IValidationDelegate delegate = new MockDelegate();

        MockControl formc = newControl(IForm.class);
        IForm form = (IForm) formc.getMock();

        IMarkupWriter writer = newWriter();
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

    {
        IUploadFile file = getFile();

        if (HiveMind.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

Examples of org.apache.tapestry.valid.IValidationDelegate

    {
        _formSupport = null;

        TapestryUtils.removeForm(cycle);

        IValidationDelegate delegate = getDelegate();

        if (delegate != null)
            delegate.setFormComponent(null);

        super.cleanupAfterRender(cycle);
    }
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        IMarkupWriter writer = newWriter();

        MockControl cyclec = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();

        IValidationDelegate delegate = newDelegate();

        MockForm form = new MockForm(delegate);

        cycle.isRewound(form);
        cyclec.setReturnValue(true);

        replayControls();

        final FormSupport fs = new FormSupportImpl(writer, cycle, form);

        verifyControls();

        delegate.clear();

        trainCycleForRewind(cyclec, cycle, "barney,wilma,barney$0", null);

        final IFormComponent barney1 = newFormComponent("barney", "barney");
        final IFormComponent wilma = newFormComponent("wilma", "wilma");
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

    {
        IMarkupWriter writer = newWriter();

        MockControl cyclec = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();
        IValidationDelegate delegate = newDelegate();

        MockForm form = new MockForm(delegate);

        cycle.isRewound(form);
        cyclec.setReturnValue(true);

        replayControls();

        final FormSupport fs = new FormSupportImpl(writer, cycle, form);

        verifyControls();

        delegate.clear();

        trainCycleForRewind(cyclec, cycle, "action$0", "action");

        final IFormComponent component = newFormComponent("action", "action$0");
View Full Code Here

Examples of org.apache.tapestry.valid.IValidationDelegate

        IMarkupWriter writer = newWriter();

        MockControl cyclec = newControl(IRequestCycle.class);
        IRequestCycle cycle = (IRequestCycle) cyclec.getMock();

        IValidationDelegate delegate = newDelegate();

        MockForm form = new MockForm(delegate);

        cycle.isRewound(form);
        cyclec.setReturnValue(true);

        replayControls();

        final FormSupport fs = new FormSupportImpl(writer, cycle, form);

        verifyControls();

        Location l = newLocation();

        delegate.clear();

        // So, the scenario here is that component "pebbles" was inside
        // some kind of conditional that evaluated to true during the render,
        // but is now false on the rewind.
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.