Package org.apache.tapestry5.json

Examples of org.apache.tapestry5.json.JSONObject


    @Test
    public void add_multiple_string_init_parameters()
    {
        JavaScriptSupport js = mockJavaScriptSupport();

        JSONObject spec = new JSONObject().put("foo", new JSONArray().put(new JSONArray("fred", "barney")));

        js.addScript("Tapestry.init(%s);", spec);

        replay();
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

        F.flow(stackLibraries).each(linkLibrary);
        F.flow(otherLibraries).each(linkLibrary);

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

            if (init != null)
                linker.setInitialization(p, init);
        }
    }
View Full Code Here

        assert priority != null;
        assert parameter != null;
        assert InternalUtils.isNonBlank(functionName);
        addCoreStackIfNeeded();

        JSONObject init = inits.get(priority);

        if (init == null)
        {
            init = new JSONObject();
            inits.put(priority, init);
        }

        JSONArray invocations = init.has(functionName) ? init.getJSONArray(functionName) : null;

        if (invocations == null)
        {
            invocations = new JSONArray();
            init.put(functionName, invocations);
        }

        invocations.put(parameter);
    }
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

        scripts.put(scriptURL);
    }

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

        "href", stylesheet.getURL(),

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

            StringBuilder builder = priorityToScript.get(p);

            if (builder != null)
                master.append(builder);

            JSONObject init = priorityToInits.get(p);

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

    {
        assert InternalUtils.isNonBlank(functionName);
        assert parameters != null;

        JSONArray list = new JSONArray().put(parameters);
        JSONObject wrapper = new JSONObject().put(functionName, list);

        addScript("Tapestry.init(%s);", wrapper);
    }
View Full Code Here

    @BeginRender
    void initAjaxLoader(MarkupWriter writer)
    {
        loader = javascriptSupport.allocateClientId("loader");

        JSONObject data = new JSONObject();
        data.put("zone", zone);
        data.put("trigger", trigger);
        data.put("loader", loader);
        javascriptSupport.addInitializerCall(InitializationPriority.NORMAL, "initAjaxLoader", data);
    }
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.