Package org.apache.tapestry

Examples of org.apache.tapestry.PageRenderSupport


        engine.getClassResolver();
        enginec.setReturnValue(getClassResolver());

        MockControl supportc = newControl(PageRenderSupport.class);
        PageRenderSupport support = (PageRenderSupport) supportc.getMock();

        trainGetPageRenderSupport(cyclec, cycle, support);

        replayControls();
View Full Code Here


        engine.getClassResolver();
        enginec.setReturnValue(getClassResolver());

        MockControl supportc = newControl(PageRenderSupport.class);
        PageRenderSupport support = (PageRenderSupport) supportc.getMock();

        trainGetPageRenderSupport(cyclec, cycle, support);

        replayControls();

        final FormSupport fs = new FormSupportImpl(writer, cycle, form);

        verifyControls();

        form.setBody(new IRender()
        {
            public void render(IMarkupWriter pwriter, IRequestCycle pcycle)
            {
                fs.addEventHandler(FormEventType.RESET, "myReset1");
                fs.addEventHandler(FormEventType.RESET, "myReset2");
            }
        });

        MockControl linkc = newControl(ILink.class);
        ILink link = (ILink) linkc.getMock();

        IRender render = (IRender) newMock(IRender.class);

        trainRegister(support);

        link.getParameterNames();
        linkc.setReturnValue(new String[]
        { "service" });

        link.getParameterValues("service");
        linkc.setReturnValue(new String[]
        { "fred" });

        writer.getNestedWriter();
        writerc.setReturnValue(nested);

        link.getURL(null, false);
        linkc.setReturnValue("/app");

        writer.begin("form");
        writer.attribute("method", "post");
        writer.attribute("action", "/app");

        writer.attribute("name", "myform");
        writer.attribute("id", "myform");

        render.render(writer, cycle);

        writer.println();

        writer.begin("div");

        trainHidden(writer, "formids", "");
        trainHidden(writer, "service", "fred");
        trainHidden(writer, "submitmode", "");

        writer.end();
       
        nested.close();

        writer.end();

        support
                .addInitializationScript("Tapestry.onreset('myform', function (event)\n{\n  myReset1();\n  myReset2();\n});\n");

        trainGetFocusField(delegatec, delegate, null);

        replayControls();
View Full Code Here

        engine.getClassResolver();
        enginec.setReturnValue(getClassResolver());

        MockControl supportc = newControl(PageRenderSupport.class);
        PageRenderSupport support = (PageRenderSupport) supportc.getMock();

        trainGetPageRenderSupport(cyclec, cycle, support);

        replayControls();
View Full Code Here

        engine.getClassResolver();
        enginec.setReturnValue(getClassResolver());

        MockControl supportc = newControl(PageRenderSupport.class);
        PageRenderSupport support = (PageRenderSupport) supportc.getMock();

        trainGetPageRenderSupport(cyclec, cycle, support);

        replayControls();
View Full Code Here

        engine.getClassResolver();
        enginec.setReturnValue(getClassResolver());

        MockControl supportc = newControl(PageRenderSupport.class);
        PageRenderSupport support = (PageRenderSupport) supportc.getMock();

        trainGetPageRenderSupport(cyclec, cycle, support);

        replayControls();

        final FormSupport fs = new FormSupportImpl(writer, cycle, form);

        verifyControls();

        form.setBody(new IRender()
        {
            public void render(IMarkupWriter pwriter, IRequestCycle pcycle)
            {
                fs.addEventHandler(FormEventType.SUBMIT, "mySubmit()");
            }
        });

        MockControl linkc = newControl(ILink.class);
        ILink link = (ILink) linkc.getMock();

        IRender render = (IRender) newMock(IRender.class);

        trainRegister(support);

        link.getParameterNames();
        linkc.setReturnValue(new String[]
        { "service" });

        link.getParameterValues("service");
        linkc.setReturnValue(new String[]
        { "fred" });

        writer.getNestedWriter();
        writerc.setReturnValue(nested);

        link.getURL(null, false);
        linkc.setReturnValue("/app");

        writer.begin("form");
        writer.attribute("method", "post");
        writer.attribute("action", "/app");

        writer.attribute("name", "myform");
        writer.attribute("id", "myform");

        render.render(writer, cycle);

        writer.println();

        writer.begin("div");

        trainHidden(writer, "formids", "");
        trainHidden(writer, "service", "fred");
        trainHidden(writer, "submitmode", "");

        writer.end();
       
        nested.close();

        writer.end();

        support
                .addInitializationScript("Tapestry.onsubmit('myform', function (event)\n{\n  mySubmit();\n});\n");

        trainGetFocusField(delegatec, delegate, null);

        replayControls();
View Full Code Here

        String name = null;

        if (_eventHandlers == null)
            return;

        PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);

        Iterator i = _eventHandlers.entrySet().iterator();

        while (i.hasNext())
        {
View Full Code Here

        form.addHiddenValue(name, hiddenId, "");

        if (!disabled)
        {
            PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);

            Map symbols = new HashMap();
            symbols.put("form", form);
            symbols.put("hiddenId", hiddenId);
View Full Code Here

    public void testRenderNormal()
    {
        IMarkupWriter writer = newBufferWriter();
        IRequestCycle cycle = newCycle();
        IScript script = new ScriptFixture();
        PageRenderSupport support = newPageRenderSupport();

        IForm form = newForm();

        LinkSubmit linkSubmit = (LinkSubmit) newInstance(LinkSubmit.class, new Object[]
        { "form", form, "name", "fred_1", "script", script, "idParameter", "fred_id" });
View Full Code Here

    protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
    {
        if (!cycle.isRewinding())
        {
            PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);

            _symbols = getInputSymbols();

            getParsedScript(cycle).execute(cycle, pageRenderSupport, _symbols);
        }
View Full Code Here

        IMarkupWriter wrappedWriter;

        if (!disabled)
        {
            PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);

            // make sure the submit function is on the page (once)
            if (cycle.getAttribute(ATTRIBUTE_FUNCTION_NAME) == null)
            {
                pageRenderSupport
                        .addBodyScript("function submitLink(form, elementId) { form._linkSubmit.value = elementId; if (form.onsubmit == null || form.onsubmit()) form.submit(); }");
                cycle.setAttribute(ATTRIBUTE_FUNCTION_NAME, this);
            }

            IForm form = getForm();
View Full Code Here

TOP

Related Classes of org.apache.tapestry.PageRenderSupport

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.