Package org.apache.tapestry5.json

Examples of org.apache.tapestry5.json.JSONObject


    {
        Object value = encoder.toValue(rowId);

        resources.triggerEvent(EventConstants.REMOVE_ROW, new Object[] { value }, null);

        return new JSONObject();
    }
View Full Code Here


        ajaxResponseRenderer.addCallback(new JavaScriptCallback()
        {
            public void run(JavaScriptSupport javascriptSupport)
            {
                javascriptSupport.importJavaScriptLibrary(library);
                javascriptSupport.addInitializerCall("writeMessageTo", new JSONObject("id", "message", "message",
                        "Updated"));
            }
        });

        // Do the rest the old way, to test backwards compatibility
View Full Code Here

    }

    @Test
    public void addInit_passes_through_to_JavaScriptSupport()
    {
        JSONObject parameter = new JSONObject("clientid", "fred");

        JavaScriptSupport js = mockJavaScriptSupport();

        js.addInitializerCall("setup", parameter);
View Full Code Here

        head.element("meta");
        head.element("script");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.setInitialization(InitializationPriority.IMMEDIATE, new JSONObject("fred", "barney"));

        linker.updateDocument(document);

        assertEquals(document.toString(), readFile("immediate_initialization.txt"));
    }
View Full Code Here

        head.element("meta");
        head.element("script");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", false);

        linker.setInitialization(InitializationPriority.IMMEDIATE, new JSONObject().put("fred", new JSONArray("barney",
                "wilma", "betty")));

        linker.updateDocument(document);

        assertEquals(document.toString(), readFile("pretty_print_initialization.txt"));
View Full Code Here

        head.element("meta");
        head.element("script");

        DocumentLinkerImpl linker = new DocumentLinkerImpl(true, "1.2.3", true);

        linker.setInitialization(InitializationPriority.NORMAL, new JSONObject("fred", "barney"));

        linker.updateDocument(document);

        assertEquals(document.toString(), readFile("other_initialization.txt"));
    }
View Full Code Here

    {
        if (!disabled)
        {
            writer.end();

            JSONObject spec = new JSONObject("form", formSupport.getClientId(), "clientId", clientId);

            spec.put("mode", mode.name().toLowerCase());

            javascriptSupport.addInitializerCall(InitializationPriority.EARLY, "linkSubmit", spec);
        }
    }
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.newPartialMarkupWriter(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);

            PrintWriter pw = response.getPrintWriter(contentType.toString());

            reply.print(pw, compactJSON);

            pw.close();
        } finally
        {
            environment.decloak();
View Full Code Here

                        zoneContainer.remove();

                        if (!reply.has("zones"))
                        {
                            reply.put("zones", new JSONObject());
                        }

                        reply.getJSONObject("zones").put(zoneId, zoneUpdateContent);
                    }
                });
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.