Delay component rendering

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Delay component rendering


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

Thanks in advance,

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]