You can create a page that has a bunch of @Blocks in it and you can
use those blocks in other pages.  We do that in Trails and it works
quite nicely.  Check out the org.apache.tapestry.util.ComponentAddress
class.  It allows you to "look up" components on other pages.  So, you
can use it this way...

public Block getReusableBlockFromAnotherPage()
{
 ComponentAddress addr = new ComponentAddress(
"MyReusableBlocksPage", "myReusableBlock" );
 return ( Block )addr.findComponent(getRequestCycle());
}

In your page, you'd do this:

<span jwcid="@RenderBlock" block="ognl:reusableBlockFromAnotherPage" />

This is off the top of my head, so the syntax might not be exactly
correct, but you get the general idea I hope.  Hope that helps!

On 11/6/06, Karthik N <[EMAIL PROTECTED]> wrote:
Hello,

"RenderBlock does not mandate that the Block being rendered be contained
within the page being rendered"

I have seen this statement at so many places - but I am looking for an
example/explanation of how to do it.

Any pointers?

Thanks, Karthik



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to