Package org.apache.tapestry.services

Examples of org.apache.tapestry.services.FormSupport


        train_getParameter(lookup, name, value);

        replay();

        FormSupport support = new FormSupportImpl(lookup);

        assertSame(support.getParameterValue(name), value);

        verify();
    }
View Full Code Here


     * Renders a <div> tag and provides an override of the {@link org.apache.tapestry.services.FormSupport}
     * environmental.
     */
    void beginRender(MarkupWriter writer)
    {
        FormSupport formSupport = _environment.peekRequired(FormSupport.class);

        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",

                       "name", _controlName,

                       "id", _clientId + ":hidden",

                       "value", String.valueOf(_visible));
        writer.end();


        _clientBehaviorSupport.addFormFragment(_clientId, _show, _hide);

        _componentActions = CollectionFactory.newList();

        // Here's the magic of environmentals ... we can create a wrapper around
        // the normal FormSupport environmental that intercepts some of the behavior.
        // Here we're setting aside all the actions inside the FormFragment so that we
        // can control whether those actions occur when the form is submitted.

        FormSupport override = new FormSupportAdapter(formSupport)
        {
            @Override
            public <T> void store(T component, ComponentAction<T> action)
            {
                Component asComponent = Defense.cast(component, Component.class, "component");
View Full Code Here

TOP

Related Classes of org.apache.tapestry.services.FormSupport

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.