Package org.apache.tapestry5.json

Examples of org.apache.tapestry5.json.JSONObject


        Object value = encoder.toValue(coerced);

        resources.triggerEvent("removeRow", new Object[]{value}, null);

        return new JSONObject();
    }
View Full Code Here


                       "src", icon.toClientURL(),

                       "alt", "[Show]");
        writer.end(); // img

        JSONObject setup = new JSONObject();

        setup.put("field", clientId);

        support.addInit("dateField", setup);
    }
View Full Code Here

        writer.end();

        Link link = resources.createActionLink(EVENT_NAME, false);


        JSONObject config = new JSONObject();
        config.put("paramName", PARAM_NAME);
        config.put("indicator", loaderId);

        if (resources.isBound("minChars")) config.put("minChars", minChars);

        if (resources.isBound("frequency")) config.put("frequency", frequency);

        if (resources.isBound("tokens"))
        {
            for (int i = 0; i < tokens.length(); i++)
            {
                config.accumulate("tokens", tokens.substring(i, i + 1));
            }
        }

        // Let subclasses do more.
        configure(config);
View Full Code Here

        return registration;
    }

    Object onActionFromJSON()
    {
        JSONObject response = new JSONObject();

        response.put("content", "Directly coded JSON content");

        return response;
    }
View Full Code Here

        ContentType contentType = new ContentType(InternalConstants.JSON_MIME_TYPE, outputEncoding);

        MarkupWriter writer = factory.newMarkupWriter(pageContentType);

        JSONObject reply = new JSONObject();

        // ... and here, the pipeline eventually reaches the PRQ to let it render the root render command.

        partialMarkupRenderer.renderMarkup(writer, reply);
View Full Code Here

/**
* @since 5.3
*/
public class StringToJSONObject  implements Coercion<String,JSONObject> {
    public JSONObject coerce(String input) {
        return new JSONObject(input);
    }
View Full Code Here

        scripts.put(scriptURL);
    }

    public void addStylesheetLink(StylesheetLink stylesheet)
    {
        JSONObject object = new JSONObject(

                "href", stylesheet.getURL(),

                "media", stylesheet.getOptions().media);
View Full Code Here

        JSONArray inits = new JSONArray();

        for (InitializationPriority p : InitializationPriority.values())
        {
            JSONObject init = priorityToInits.get(p);

            if (init != null)
                inits.put(init);
        }
View Full Code Here

        environment.peek(Heartbeat.class).begin();
    }

    private void addJavaScriptInitialization()
    {
        JSONObject validateSpec = new JSONObject().put("blur", clientValidation == ClientValidation.BLUR).put("submit",
                clientValidation != ClientValidation.NONE);

        JSONObject spec = new JSONObject("formId", clientId).put("validate", validateSpec);

        javascriptSupport.addInitializerCall(InitializationPriority.EARLY, "formEventManager", spec);
    }
View Full Code Here

    void cleanupRender()
    {
        popContext();

        JSONObject spec = new JSONObject();

        spec.put("rowInjector", rowInjector.getClientId());
        spec.put("addRowTriggers", addRowTriggers);

        renderSupport.addInit("ajaxFormLoop", spec);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.json.JSONObject

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.