Package org.apache.tapestry.json

Examples of org.apache.tapestry.json.JSONLiteral


       
        // TODO: Should find some way to provide this globally and cache.
        DecimalFormatSymbols symbols = new DecimalFormatSymbols(context.getLocale());
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isInRange,{"
                        + "max:" + _max + ","
                        + "decimal:" + JSONObject.quote(symbols.getDecimalSeparator())
                        + "}]"));
       
        accumulateProfileProperty(field, profile,
View Full Code Here


            profile.put(ValidationConstants.CONSTRAINTS, new JSONObject());
        }
        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isEmailAddress,false,true]"));
       
        accumulateProfileProperty(field, profile,
                ValidationConstants.CONSTRAINTS, buildMessage(context, field));
    }
View Full Code Here

            profile.put(ValidationConstants.CONSTRAINTS, new JSONObject());
        }
        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[tapestry.form.validation.isValidPattern,\""
                        + pattern + "\"]"));
       
        accumulateProfileProperty(field, profile,
                ValidationConstants.CONSTRAINTS, buildMessage(context, field));
    }
View Full Code Here

            profile.put(ValidationConstants.CONSTRAINTS, new JSONObject());
        }
        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isText,{"
                        + "maxlength:" + _maxLength + "}]"));
       
        accumulateProfileProperty(field, profile,
                ValidationConstants.CONSTRAINTS, buildMessage(context, field));
    }
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,{"
                        + "min:"
                        + JSONObject.quote(translator.format(field, context.getLocale(), _minDate))
                        + ","
                        + "format:"
                        + JSONObject.quote(Strftime.convertToPosixFormat(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))
                        + ","
                        + "format:"
                        + JSONObject.quote(Strftime.convertToPosixFormat(translator.getPattern()))
View Full Code Here

            profile.put(ValidationConstants.CONSTRAINTS, new JSONObject());
        }
        JSONObject cons = profile.getJSONObject(ValidationConstants.CONSTRAINTS);
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isText,{"
                        + "minlength:" + _minLength + "}]"));
       
        accumulateProfileProperty(field, profile,
                ValidationConstants.CONSTRAINTS, buildMessage(context, field));
    }
View Full Code Here

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

       
        // TODO: Should find some way to provide this globally and cache.
        DecimalFormatSymbols symbols = new DecimalFormatSymbols(context.getLocale());
       
        accumulateProperty(cons, field.getClientId(),
                new JSONLiteral("[dojo.validate.isInRange,{"
                        + "min:" + _min + ","
                        + "decimal:" + JSONObject.quote(symbols.getDecimalSeparator())
                        + "}]"));
       
        accumulateProfileProperty(field, profile,
View Full Code Here

            String js = "tapestry.form." + type + "('" + form.getClientId() + "', '" + getName() + "'";
           
            if (isAsync)
            {
                JSONObject json = new JSONObject();
                json.put(new JSONLiteral("async"), Boolean.TRUE);
                json.put(new JSONLiteral("json"), isJson());

                DirectServiceParameter dsp = new DirectServiceParameter(form, null, this);
                json.put(new JSONLiteral("url"), new JSONLiteral("this.href"));

                writer.attribute("href", getDirectService().getLink(true, dsp).getURL());
                writer.attribute("onClick", js + "," + json.toString() + "); return false;");                       
            } else {
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.