Package org.apache.tapestry5.json

Examples of org.apache.tapestry5.json.JSONObject


        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject spec1 = new JSONObject("clientId", "chuck");
        JSONObject spec2 = new JSONObject("clientId", "fred");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(spec1, spec2));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();
View Full Code Here


        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray("chuck", "charley"));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();
View Full Code Here

        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONArray chuck = new JSONArray("chuck", "yeager");
        JSONArray buzz = new JSONArray("buzz", "aldrin");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(chuck, buzz));

        linker.setInitialization(InitializationPriority.IMMEDIATE, aggregated);

        replay();
View Full Code Here

        DocumentLinker linker = mockDocumentLinker();
        JavaScriptStackSource stackSource = mockJavaScriptStackSource();
        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray().put("chuck"));

        linker.setInitialization(InitializationPriority.NORMAL, aggregated);

        replay();
View Full Code Here

        JavaScriptStackPathConstructor pathConstructor = mockJavaScriptStackPathConstructor();
        trainForEmptyCoreStack(linker, stackSource, pathConstructor);

        JSONArray chuck = new JSONArray("chuck", "yeager");

        JSONObject aggregated = new JSONObject().put("setup", new JSONArray(chuck));

        linker.setInitialization(InitializationPriority.NORMAL, aggregated);

        replay();
View Full Code Here

    void cleanupRender()
    {
        popContext();

        JSONObject spec = new JSONObject();

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

        jsSupport.addInitializerCall("ajaxFormLoop", spec);
    }
View Full Code Here

        Object value = encoder.toValue(rowId);

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

        return new JSONObject();
    }
View Full Code Here

        "class", "t-autocomplete-menu");
        writer.end();

        Link link = resources.createEventLink(EVENT_NAME);

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

        JSONObject spec = new JSONObject("elementId", id, "menuId", menuId, "url", link.toURI()).put("config",
                config);

        jsSupport.addInitializerCall("autocompleter", spec);
    }
View Full Code Here

    private JavaScriptSupport javascriptSupport;

    @HeartbeatDeferred
    void beginRender()
    {
        JSONObject spec = new JSONObject("triggerId", container.getClientId(), "fragmentId", fragment.getClientId()).put("invert", invert);

        javascriptSupport.addInitializerCall("linkTriggerToFormFragment", spec);
    }
View Full Code Here

   }

   @AfterRender
   void addJavaScript()
   {
      JSONObject params = new JSONObject();
     
      params.put("period", period);
      params.put("id", zone.getClientId());
      params.put("URL", createEventLink());
     
      javaScriptSupport.addInitializerCall(InitializationPriority.LATE, "zoneRefresh", params);
   }
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.