Package org.apache.tapestry.dom

Examples of org.apache.tapestry.dom.Element$Attribute


        setFormSupport(component, formSupport);

        component.beginRender(writer);

        Element element = writer.getElement();
        assertNotNull(element);
        assertEquals(element.getName(), "input");
        assertEquals(element.getAttribute("type"), "file");
        // assertEquals(element.getAttribute("name"),null);
        // assertEquals(element.getAttribute("id"),null);

        verify();
View Full Code Here


        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);

        replay();

        Element e = writer.element("label", "accesskey", "f");

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null);

        decorator.insideLabel(field, e);
View Full Code Here

        train_peekRequired(env, ValidationTracker.class, tracker);
        train_inError(tracker, field, true);

        replay();

        Element e = writer.element("label", "accesskey", "f", "class", "foo");

        ValidationDecorator decorator = new DefaultValidationDecorator(env, null, null);

        decorator.insideLabel(field, e);
View Full Code Here

    {
        String appPackage = "org.apache.tapestry.integration.app2";
        String appName = "";
        _tester = new PageTester(appPackage, appName);
        Document doc = _tester.renderPage("TestPageForForm");
        Element form = doc.getElementById("form1");
        Map<String, String> fieldValues = CollectionFactory.newMap();
        fieldValues.put("t1", "hello");
        doc = _tester.submitForm(form, fieldValues);
        assertTrue(doc.toString().contains("You entered: hello"));
    }
View Full Code Here

    private Map<String, String> _fieldValues;

    @Test
    public void submit_form()
    {
        Element submitButton = _doc.getElementById("capitalize1");
        _fieldValues.put("t1", "hello");
        _doc = _tester.clickSubmit(submitButton, _fieldValues);
        assertTrue(_doc.toString().contains("Value is: HELLO"));
    }
View Full Code Here

    }

    @Test
    public void access_following_fields()
    {
        Element submitButton = _doc.getElementById("capitalize2");
        _fieldValues.put("t2", "world");
        _doc = _tester.clickSubmit(submitButton, _fieldValues);
        assertTrue(_doc.toString().contains("Value is: WORLD"));
    }
View Full Code Here

    }

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void not_a_submit()
    {
        Element submitButton = _doc.getElementById("t1");
        _tester.clickSubmit(submitButton, _fieldValues);
    }
View Full Code Here

    }

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void not_in_form()
    {
        Element submitButton = _doc.getElementById("orphanedSubmit");
        _tester.clickSubmit(submitButton, _fieldValues);
    }
View Full Code Here

        component.injectDecorator(new StubValidationDecorator());
        component.injectFormSupport(formSupport);

        component.beginRender(writer);

        Element element = writer.getElement();
        assertNotNull(element);
        assertEquals(element.getName(), "input");
        assertEquals(element.getAttribute("type"), "file");
        // assertEquals(element.getAttribute("name"),null);
        // assertEquals(element.getAttribute("id"),null);

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

TOP

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

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.