Package org.apache.tapestry

Examples of org.apache.tapestry.PageRenderSupport


     * @see org.apache.tapestry.form.validator.AbstractValidatableField#render(org.apache.tapestry.IMarkupWriter,
     *      org.apache.tapestry.IRequestCycle, java.lang.String)
     */
    public void render(IMarkupWriter writer, IRequestCycle cycle, String value)
    {
        PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);

        boolean disabled = isDisabled();
        DateTranslator translator = (DateTranslator) getTranslator();
        Locale locale = getPage().getLocale();
        SimpleDateFormat format = translator.getDateFormat(locale);
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

        IScript script = source.getScript(location);

        // If there's an error, report it against the field (this validator object doesn't
        // have a location).

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

        script.execute(cycle, pageRenderSupport, finalSymbols);
    }
View Full Code Here

        train_toClientURL(asset, ASSET_URL);
        builder.addScriptLink(ASSET_URL);

        replay();

        PageRenderSupport support = new PageRenderSupportImpl(builder, null, null);

        support.addScriptLink(asset);

        verify();
    }
View Full Code Here

        train_toClientURL(asset, ASSET_URL);
        builder.addScriptLink(ASSET_URL);

        replay();

        PageRenderSupport support = new PageRenderSupportImpl(builder, symbolSource, assetSource,
                                                              CORE_ASSET_PATH_UNEXPANDED);

        support.addScriptLink(asset);

        verify();
    }
View Full Code Here

        builder.addScript("Tapestry.Foo(\"bar\");");

        replay();

        PageRenderSupport support = new PageRenderSupportImpl(builder, null, null);

        support.addScript("Tapestry.Foo(\"%s\");", "bar");

        verify();
    }
View Full Code Here

        train_toClientURL(asset, ASSET_URL);
        builder.addScriptLink(ASSET_URL);

        replay();

        PageRenderSupport support = new PageRenderSupportImpl(builder, source, assetSource);

        support.addClasspathScriptLink(path);

        verify();
    }
View Full Code Here

        train_toClientURL(asset, ASSET_URL);
        builder.addStylesheetLink(ASSET_URL, media);

        replay();

        PageRenderSupport support = new PageRenderSupportImpl(builder, null, null);

        support.addStylesheetLink(asset, media);

        verify();
    }
View Full Code Here

public class ZoneSetupImplTest extends TapestryTestCase
{
    @Test
    public void no_changes()
    {
        PageRenderSupport support = mockPageRenderSupport();

        replay();

        ZoneSetupImpl setup = new ZoneSetupImpl(support);
View Full Code Here

    }

    @Test
    public void add_links()
    {
        PageRenderSupport support = mockPageRenderSupport();

        JSONObject template = new JSONObject("{ zones: [], links: [['client1', 'zone1'], ['client2', 'zone2']] }");

        support.addScript(INITIALIZER_STRING, template.getJSONArray("zones"), template.getJSONArray("links"));

        replay();

        ZoneSetupImpl setup = new ZoneSetupImpl(support);
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.