Package org.apache.tapestry.dom

Examples of org.apache.tapestry.dom.Element


    {
        notNull(submitButton, "submitButton");

        assertIsSubmit(submitButton);

        Element form = getFormAncestor(submitButton);
        String value = submitButton.getAttribute("value");

        if (value == null) value = DEFAULT_SUBMIT_VALUE_ATTRIBUTE;

        fieldValues.put(submitButton.getAttribute("name"), value);
View Full Code Here


    public void renderPartial(MarkupWriter writer, JSONObject reply)
    {
        // The partial will quite often contain multiple elements (or just a block of plain text),
        // so those must be enclosed in a root element.

        Element root = writer.element("ajax-partial");

        // The initialize methods will already have been invoked.

        render(writer);

        writer.end();

        String content = root.getChildMarkup().trim();

        reply.put("content", content);
    }
View Full Code Here

                if (line == current) writer.getElement().addClassName("t-location-current");

                writer.write(Integer.toString(current));
                writer.end();

                Element td = writer.element("td", "class", "t-location-content");

                if (line == current) td.addClassName("t-location-current");

                if (start == current) td.addClassName("t-location-content-first");

                writer.write(input);
                writer.end();

                writer.end(); // tr
View Full Code Here

    @Test
    public void element_nesting()
    {
        MarkupWriter w = new MarkupWriterImpl();

        Element root = w.element("root");

        w.attributes("foo", "bar");

        w.write("before child");

        assertNotSame(w.element("nested"), root);

        w.write("inner text");

        assertSame(w.end(), root);

        w.write("after child");

        root.attribute("gnip", "gnop");

        assertEquals(w.toString(),
                     "<root foo=\"bar\" gnip=\"gnop\">before child<nested>inner text</nested>after child</root>");
    }
View Full Code Here

    @Test
    public void element_nesting()
    {
        MarkupWriter w = new MarkupWriterImpl();

        Element root = w.element("root");

        w.attributes("foo", "bar");

        w.write("before child");

        assertNotSame(w.element("nested"), root);

        w.write("inner text");

        assertSame(w.end(), root);

        w.write("after child");

        root.attribute("gnip", "gnop");

        assertEquals(
                w.toString(),
                "<root foo=\"bar\" gnip=\"gnop\">before child<nested>inner text</nested>after child</root>");
    }
View Full Code Here

        ComponentInvocationMap map = newComponentInvocationMap();

        MarkupWriter writer = new MarkupWriterImpl(new XMLMarkupModel(), map);
        Link link = newLink();

        Element e = writer.element("form");

        map.store(e, link);

        replay();
View Full Code Here

    public Document clickSubmit(Element submitButton, Map<String, String> fieldValues)
    {
        final String DEFAULT_SUBMIT_VALUE_ATTRIBUTE = "Submit Query";
        Defense.notNull(submitButton, "submitButton");
        assertIsSubmit(submitButton);
        Element form = getFormAncestor(submitButton);
        String value = submitButton.getAttribute("value");
        if (value == null)
        {
            value = DEFAULT_SUBMIT_VALUE_ATTRIBUTE;
        }
View Full Code Here

    void beginRender(MarkupWriter writer)
    {
        _clientId = _pageRenderSupport.allocateClientId(_resources);

        Element e = writer.element("div", "id", _clientId);

        _resources.renderInformalParameters(writer);

        e.addClassName("t-zone");

        if (!_visible) e.addClassName("t-invisible");

        // And continue on to render the body

        JSONObject spec = new JSONObject();
        spec.put("div", _clientId);
View Full Code Here

    public void renderPartial(MarkupWriter writer, JSONObject reply)
    {
        // The partial will quite often contain multiple elements (or just a block of plain text),
        // so those must be enclosed in a root element.

        Element root = writer.element("ajax-partial");

        // The initialize methods will already have been invoked.

        render(writer);

        writer.end();

        String content = root.getChildMarkup().trim();

        reply.put("content", content);
    }
View Full Code Here

        String id = _resources.getId();

        _controlName = formSupport.allocateControlName(id);
        _clientId = _pageRenderSupport.allocateClientId(id);

        Element element = writer.element("div", "id", _clientId);

        _resources.renderInformalParameters(writer);

        if (!_visible)
            element.addClassName(TapestryConstants.INVISIBLE_CLASS);


        writer.element("input",

                       "type", "hidden",
View Full Code Here

TOP

Related Classes of org.apache.tapestry.dom.Element

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.