Many components do this, pseudo code follows:

protected void renderComponent(...)
{
IMarkupWriter nested = writer.getNestedWriter();

renderBody(nested, cycle);

// Do my rendering here ...

nested.close(); // Output buffered content
}

On 5/17/05, SG <[EMAIL PROTECTED]> wrote:
> 
> Hi,
> 
> I wanted to know if there is a way to delay/postpone the rendering of
> a particular component programmatically. Here is the scenario -
> 
> I have an error component, which works off of a collection of messages
> that is stored in the containing page. As components on the page
> render, they populate the page message collection with various
> messages by type (info, error, warning, etc.). The error component
> applies the relevant stylesheets for each message type and displays
> them on the screen.
> 
> The key thing to note is that the error component is located at the
> top of the page before the other components. As such, Tapestry renders
> the error component first, then the other components. So, any messages
> from the follow-up components are populated in the messages
> collection, but not rendered on the screen. The next time the form
> submits, those messages render, but they are stale messages from the
> previous request.
> 
> Question: Is there a way to delay the rendering of a component until
> the end of the page render? In this case, I want the error component
> to undergo its render process at the end of the page render, after all
> the other components are rendered. But, I still want it to show it at
> the top of the page before other components.
> 
> If I move the error component as the last component on the page,
> everything works fine, but the messages show at the bottom of the
> page.
> 
> Thanks in advance,
> --
> -SG
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com

Reply via email to