Package org.apache.tapestry.json

Examples of org.apache.tapestry.json.JSONLiteral


            profile.put(ValidationConstants.CONSTRAINTS, new JSONObject());
        }
        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())
View Full Code Here


            profile.put(ValidationConstants.CONSTRAINTS, new JSONObject());
        }
        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())
View Full Code Here

            minString = translator.format(field, context.getLocale(), new Double(_min));
        else
            minString = String.valueOf(_min);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isInRange,{"
                        + "min:" + minString + ","
                        + "decimal:" + JSONObject.quote(symbols.getDecimalSeparator())
                        + ",separator:" + JSONObject.quote(symbols.getGroupingSeparator())
                        + "}]"));
       
View Full Code Here

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

            maxString = translator.format(field, context.getLocale(), new Double(_max));
        else
            maxString = String.valueOf(_max);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isInRange,{"
                        + "max:" + maxString + ","
                        + "decimal:" + JSONObject.quote(symbols.getDecimalSeparator())
                        + ",separator:" + JSONObject.quote(symbols.getGroupingSeparator())
                        + "}]"));
       
View Full Code Here

        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        DecimalFormat format = getDecimalFormat(context.getLocale());
       
        cons.accumulate(field.getClientId(),
                new JSONLiteral("[dojo.validate.isRealNumber,{"
                        + "places:" + format.getMaximumFractionDigits() + ","
                        + "decimal:"
                        + JSONObject.quote(format.getDecimalFormatSymbols().getDecimalSeparator())
                        + ",separator:" + JSONObject.quote(format.getDecimalFormatSymbols().getGroupingSeparator())
                        + "}]"));
View Full Code Here

            grouping += ",separator:\"\"";
        }

        cons.accumulate(field.getClientId(),
                        new JSONLiteral("[tapestry.form.validation.isReal,null,{"
                                        + "places:" + format.getMaximumFractionDigits() + ","
                                        + "decimal:"
                                        + JSONObject.quote(format.getDecimalFormatSymbols().getDecimalSeparator())
                                        + grouping
                                        + "}]"));
View Full Code Here

            symbols = new DecimalFormatSymbols(context.getLocale());
        }

        accumulateProperty(cons, field.getClientId(),
                           new JSONLiteral("[tapestry.form.validation.lessThanOrEqual,"
                                           + JSONObject.quote(maxString)
                                           + ",{"
                                           + "decimal:" + JSONObject.quote(symbols.getDecimalSeparator())
                                           + grouping
                                           + "}]"));
View Full Code Here

            symbols = new DecimalFormatSymbols(context.getLocale());
        }

        accumulateProperty(cons, field.getClientId(),
                           new JSONLiteral("[tapestry.form.validation.greaterThanOrEqual,"
                                           + JSONObject.quote(minString)
                                           + ",{"
                                           + "decimal:" + JSONObject.quote(symbols.getDecimalSeparator())
                                           + grouping
                                           + "}]"));
View Full Code Here

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

TOP

Related Classes of org.apache.tapestry.json.JSONLiteral

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.