Package org.apache.tapestry.form

Examples of org.apache.tapestry.form.FormComponentContributorContext


        JSONObject json = new JSONObject();

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

        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);

        expect(context.getProfile()).andReturn(json);

        trainGetLocale(context, Locale.US);

        trainBuildMessage(context, null, ValidationStrings.INVALID_NUMBER, new String[] { "Number Field", "#,##" },
                          "invalid number message");
View Full Code Here


        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
       
        JSONObject json = new JSONObject();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);

        expect(context.getProfile()).andReturn(json);
       
        trainGetLocale(context, Locale.ENGLISH);
       
        trainBuildMessage(
                context,
View Full Code Here

        JSONObject json = new JSONObject();
       
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        expect(context.getProfile()).andReturn(json);
       
        trainGetLocale(context, Locale.ENGLISH);
       
        trainBuildMessage(context, null, ValidationStrings.INVALID_NUMBER, new Object[]
        { "Number Field", "#" }, "invalid number message");
       
        expect(context.getProfile()).andReturn(json);
       
        replay();

        translator.setTrim(true);
       
View Full Code Here

       
        expect(field.getClientId()).andReturn("myfield").anyTimes();
       
        expect(field.getDisplayName()).andReturn("My Field");
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        Locale locale = Locale.ENGLISH;
        expect(context.getLocale()).andReturn(locale).anyTimes();
       
        expect(context.getProfile()).andReturn(json);
       
        context.addInitializationScript(field, "dojo.require(\"tapestry.form.datetime\");");
       
        String strMin = translator.format(field, locale, minDate);
       
        trainFormatMessage(context, null, ValidationStrings.DATE_TOO_EARLY,
                new Object[] { "My Field", strMin }, "default message");
View Full Code Here

       
        expect(field.getClientId()).andReturn("myfield").anyTimes();
       
        expect(field.getDisplayName()).andReturn("My Field");
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        Locale locale = Locale.ENGLISH;
        expect(context.getLocale()).andReturn(locale).anyTimes();
       
        expect(context.getProfile()).andReturn(json);
       
        context.addInitializationScript(field, "dojo.require(\"tapestry.form.datetime\");");
       
        String strMin = translator.format(field, locale, minDate);
       
        trainFormatMessage(context, "custom", ValidationStrings.DATE_TOO_EARLY,
                new Object[] { "My Field", strMin },
View Full Code Here

        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
       
        IFormComponent field = newField("My Field", "myfield");
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        expect(context.getProfile()).andReturn(json);
       
        trainFormatMessage(context, null, ValidationStrings.VALUE_TOO_LONG,
                new Object[] { new Integer(20), "My Field" }, "default\\message");
       
        replay();
View Full Code Here

    public void testRenderContribution()
    {
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        FormComponentContributorContext context = newContext();
        IFormComponent field = newField();

        Validator delegate = newValidator();

        delegate.renderContribution(writer, cycle, context, field);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.form.FormComponentContributorContext

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.