Package org.apache.tapestry5.dom

Examples of org.apache.tapestry5.dom.Element.attributes()


    {
        MarkupWriter w = new MarkupWriterImpl();

        w.element("root");

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

        assertEquals(w.toString(), "<root foo=\"bar\" gnip=\"gnop\"></root>");
    }

    @Test
View Full Code Here


        train_get(binding, rawValue);

        train_coerce(pageResources, rawValue, String.class, convertedValue);

        writer.attributes("fred", convertedValue);

        replay();

        InternalComponentResources resources = new InternalComponentResourcesImpl(null, element, null, pageResources,
                                                                                  null, null, ins);
View Full Code Here

    @Test(expectedExceptions = IllegalStateException.class)
    public void attributes_with_no_current_element()
    {
        MarkupWriter w = new MarkupWriterImpl();

        w.attributes("fail", "now");
    }

    @Test
    public void current_element_at_end_of_root_element_is_null()
    {
View Full Code Here

    {
        MarkupWriter w = new MarkupWriterImpl();

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

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

        w.write("before child");

        assertNotSame(w.element("nested"), root);
View Full Code Here

    {
        MarkupWriter w = new MarkupWriterImpl();

        w.element("root");

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

        assertEquals(w.toString(), "<root foo=\"bar\" gnip=\"gnop\"/>");
    }

    @Test
View Full Code Here

            Element element = scriptsAtTop
                              ? body.elementAt(i, "script")
                              : body.element("script");

            element.attributes("src", scriptURL, "type", "text/javascript");
        }
    }

    /**
     * Locates the head element under the root ("html") element, creating it if necessary, and adds the stylesheets to
View Full Code Here

     */
    void afterRender(MarkupWriter writer)
    {
        Element hidden = hiddenFieldPositioner.getElement();

        hidden.attributes("type", "hidden",

                "name", Form.FORM_DATA,


                "value", componentActions.getClientData());
View Full Code Here

        if (!alwaysSubmit)
        {
            // Make it possible for the FormFragment to locate the hidden field, even if
            // FormFragments get nested in some complex way.  When the always submit option
            // is enabled, there's no need for the hidden field to be locatable.
            hidden.attributes("data-for-fragment", clientId);
        }

        writer.end(); // div

View Full Code Here

        // If it is an HTML document, with a root HTML node, add attributes
        // to describe locale, and if debug is enabled.
        if (html != null)
        {
            html.attributes("data-locale", threadLocale.getLocale().toString());

            if (debugEnabled)
            {
                html.attributes("data-debug-enabled", "true");
            }
View Full Code Here

        {
            html.attributes("data-locale", threadLocale.getLocale().toString());

            if (debugEnabled)
            {
                html.attributes("data-debug-enabled", "true");
            }

        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.