Package org.apache.tapestry.form.translator

Examples of org.apache.tapestry.form.translator.DateTranslator.format()


        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "min:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _minDate))
                        + ","
                        + "format:"
                        + JSONObject.quote(Strftime.convertToPosixFormat(translator.getPattern()))
                        + "}]"));
       
View Full Code Here


        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "max:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _maxDate))
                        + ","
                        + "format:"
                        + JSONObject.quote(Strftime.convertToPosixFormat(translator.getPattern()))
                        + "}]"));
       
View Full Code Here

        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "min:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _minDate))
                        + ","
                        + "datePattern:"
                        + JSONObject.quote(translator.getPattern())
                        + (translator.isLenient() ? "" : ",strict:true")
                        + "}]"));
View Full Code Here

        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "max:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _maxDate))
                        + ","
                        + "datePattern:"
                        + JSONObject.quote(translator.getPattern())
                        + (translator.isLenient() ? "" : ",strict:true")
                        + "}]"));
View Full Code Here

       
        expect(context.getProfile()).andReturn(json);
       
        context.addInitializationScript(field, "dojo.require(\"tapestry.form.datetime\");");
       
        String strMax = translator.format(field, locale, maxDate);
       
        trainFormatMessage(context, null, ValidationStrings.DATE_TOO_LATE,
                new Object[] { "My Field", strMax }, "default message");
       
        replay();
View Full Code Here

        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "min:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _minDate))
                        + ","
                        + "datePattern:"
                        + JSONObject.quote(translator.getPattern())
                        + (translator.isLenient() ? "" : ",strict:true")
                        + "}]"));
View Full Code Here

        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.datetime.isValidDate,{"
                        + "max:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _maxDate))
                        + ","
                        + "datePattern:"
                        + JSONObject.quote(translator.getPattern())
                        + (translator.isLenient() ? "" : ",strict:true")
                        + "}]"));
View Full Code Here

       
        expect(context.getProfile()).andReturn(json);
       
        context.addInitializationScript(field, "dojo.require(\"tapestry.form.datetime\");");
       
        String strMax = translator.format(field, locale, maxDate);
       
        trainFormatMessage(context, "custom", ValidationStrings.DATE_TOO_LATE,
                new Object[] { "My Field", strMax },
                "custom\\message");
       
View Full Code Here

       
        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");
       
        replay();
View Full Code Here

       
        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 },
                "custom\\message");
       
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.