Thanks, that's great to know.

So that seems to narrow it down to some issue in my approach then, as I am not able to see anything written from my MarkupWriter in the @BeginRender phase. I have components using just the MarkupWriter for output working, so I know it works in general.

I'm trying to have the MarkupWriter begin it's rendering after the content from the TML:

Page TML

<html t:type="customerlayout" title="Customer Interface"

      t:sidebarTitle=" "

      xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";

      xmlns:p="tapestry:parameter">

      <p:contentInfo>

          <t:CustomerInfo noedit="true" />

      </p:contentInfo>

        <!--*MarkupWriter Content goes here*-->
</html>

Layout TML (edited down for clarity)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

        <html xmlns="http://www.w3.org/1999/xhtml"; 
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"; xmlns:p="tapestry:parameter">

    <head>

        <meta http-equiv="X-UA-Compatible" content="IE=7" />

        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>

        <title>${title}</title>

    </head>

    <body>

        <div class="header" />
        <div class="mainNav" />

<div class="page-container">
            <div class="content">



                <div class="contentInfo">

                    <t:if test="contentInfo">

                        <t:delegate to="contentInfo" />

                    </t:if>

                </div>

                *<t:body />  <!-- this is where I'd expect the markup content to 
occur -->*

                <br style="clear: both;"/>

                <div class="footer" />

            </div>

        </div>

    </body>

</html>


MarkupWriter method:

    @BeginRender

    public void getSelectedTab(MarkupWriter writer){

        writer.element("div","id","tabContent");

        writer.element("h2");

        writer.write("Test");

        writer.end();

        writer.end();

    }


Thanks,
Rich


On 12/20/2010 05:21 PM, Howard Lewis Ship wrote:
Yes, absolutely.  Behind the scenes, the templates are parsed into
collections of objects that operate on MarkupWriter, so you can mix a
template with render phase methods and many other tricks.

On Mon, Dec 20, 2010 at 2:10 PM, Rich M<rich...@moremagic.com>  wrote:

Hi,

is it possible to use the MarkupWriter in the page class in a render stage
in addition to a template?

The page I'm trying to write needs to feed a component into a delegate from
the Layout.tml it belongs to. As far as I can figure out I can only write
Tapestry components in the TML file and not with the MarkupWriter. That is
to say, my attempts to do so have failed and searching various ends online
hasn't shown me otherwise.

On the other hand, I want to use the MarkupWriter to build a dynamic set of
HTML elements. Specifically, to build a collapsing/expanding hierarchy of
Categories built into a form that I will process.

By doing the HTML elements in the page class, I figured I could keep track
of the elements and their attributes/etc with the least pain so I can
process them properly on a form submission.

This is 5.1.0.5 by the way.

Thanks,
Rich

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




Reply via email to