Examples of IFormComponent


Examples of org.apache.tapestry.form.IFormComponent

        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle(form);

        MockControl fieldc = newControl(IFormComponent.class);

        IFormComponent field = (IFormComponent) fieldc.getMock();

        Location l = newLocation();
        IPage page = newPage();

        FieldLabel fl = (FieldLabel) _creator.newInstance(FieldLabel.class, new Object[]
        { "id", "label", "location", l, "field", field, "page", page, "container", page });

        form.prerenderField(writer, field, l);

        field.getDisplayName();
        fieldc.setReturnValue(null);

        field.getExtendedId();
        fieldc.setReturnValue("Fred/field");

        replayControls();

        try
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        IForm form = TapestryUtils.getForm(cycle, this);

        IFormComponent field = getField();

        if (field != null && isPrerender())
            form.prerenderField(writer, field, getLocation());

        if (cycle.isRewinding()) return;

        String displayName = getDisplayName();

        if (displayName == null)
        {
            if (field == null)
                throw Tapestry.createRequiredParameterException(this, "field");

            displayName = field.getDisplayName();

            if (displayName == null)
                throw new BindingException(ValidMessages.noDisplayName(this,
                        field), this, null, getBinding("field"), null);
        }

        IValidationDelegate delegate = form.getDelegate();

        String id = field == null ? null : field.getClientId();

        delegate.writeLabelPrefix(field, writer, cycle);

        writer.begin("label");
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        assertEquals(expected, validator.toObject(null, "-12345"));
    }

    public void testToObjectFailure()
    {
        IFormComponent field = newField("BamBam");

        replayControls();

        IValidator validator = new IntValidator();
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        }
    }

    public void testToObjectTooSmall()
    {
        IFormComponent field = newField("Fred");

        replayControls();

        IValidator validator = new IntValidator("minimum=10");
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        }
    }

    public void testToObjectTooLarge()
    {
        IFormComponent field = newField("Barney");

        replayControls();

        IValidator validator = new IntValidator("maximum=10");
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        }
    }

    public void testScriptSymbolsJustFormat()
    {
        IFormComponent field = newField("Fred");

        replayControls();

        IntValidator validator = new IntValidator();
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        verifyControls();
    }

    public void testScriptSymbolsRequired()
    {
        IFormComponent field = newField("Barney", 2);

        replayControls();

        IntValidator validator = new IntValidator("required");
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        verifyControls();
    }

    public void testScriptSymbolsMinimum()
    {
        IFormComponent field = newField("Barney", 2);

        replayControls();

        IntValidator validator = new IntValidator("minimum=5");
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        verifyControls();
    }
   
    public void testScriptSymbolsMaximum()
    {
        IFormComponent field = newField("Barney", 2);

        replayControls();

        IntValidator validator = new IntValidator("maximum=5");
View Full Code Here

Examples of org.apache.tapestry.form.IFormComponent

        verifyControls();
    }   
   
    public void testScriptSymbolsRange()
    {
        IFormComponent field = newField("Barney", 2);

        replayControls();

        IntValidator validator = new IntValidator("maximum=5,minimum=1");
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.