Package org.apache.tapestry.form

Examples of org.apache.tapestry.form.FormComponentContributorContext


    {
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        IFormComponent field = newField("Fred", "fred", false);
       
        context.registerForFocus(ValidationConstants.REQUIRED_FIELD);
       
        expect(context.getProfile()).andReturn(json);
       
        trainFormatMessage(
                context,
                null,
                ValidationStrings.REQUIRED_FIELD,
View Full Code Here


    {
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        IFormComponent field = newField(true);
       
        replay();
       
View Full Code Here

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

    {
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        IFormComponent field = newField("Fred", "barney");
       
        expect(context.getProfile()).andReturn(json);
       
        trainFormatMessage(
                context,
                "custom",
                ValidationStrings.INVALID_EMAIL,
View Full Code Here

    public void test_Render_Contribution()
    {
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
        IFormComponent field = newField("My Field", "myfield");

        Locale locale = Locale.GERMAN;
        DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);

        expect(context.getLocale()).andReturn(locale).anyTimes();
        expect(context.getProfile()).andReturn(json);

        trainFormatMessage(context, null, ValidationStrings.VALUE_TOO_LARGE,
                           new Object[] {
                                   "My Field",
                                   new Double(20).toString()
View Full Code Here

    public void test_Render_Contribution_Custom_Message()
    {
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
        IFormComponent field = newField("My Field", "myfield");

        Locale locale = Locale.JAPAN;
        DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale);

        expect(context.getLocale()).andReturn(locale).anyTimes();
        expect(context.getProfile()).andReturn(json);

        trainFormatMessage(
                context,
                "custom",
                ValidationStrings.VALUE_TOO_LARGE,
View Full Code Here

       
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        IFormComponent field = newField("Fred", "myfield");
       
        expect(context.getProfile()).andReturn(json);
       
        trainFormatMessage(context, null, ValidationStrings.PATTERN_MISMATCH,
                new Object[] { "Fred", rawPattern }, "default message");
       
        replay();
View Full Code Here

       
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
        JSONObject json = new JSONObject();
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);
       
        IFormComponent field = newField("Fred", "myfield");
       
        expect(context.getProfile()).andReturn(json);
       
        trainFormatMessage(
                context,
                "custom",
                ValidationStrings.PATTERN_MISMATCH,
View Full Code Here

        expect(field.isDisabled()).andReturn(false);
       
        IFormComponent otherField = newField("Verify Password", "pass2");
        trainGetContainerAndComponent(field, "other", otherField);
       
        FormComponentContributorContext context = newMock(FormComponentContributorContext.class);       
        expect(context.getProfile()).andReturn(json);       
               
        trainIdentityMessages(context, null, "Password", "Verify Password", 1, "Fields must match");       
       
        IMarkupWriter writer = newWriter();
        IRequestCycle cycle = newCycle();
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_SHORT,
                new Object[] { new Integer(25), "My Field" }, "default\\message");
       
        replay();
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.