You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Marko Mrkus <ma...@bumblehood.com> on 2009/08/14 15:22:47 UTC

Render body of the component in some other component

Hi, all!

 

Can you tell me is it possible to render body of a component in some other
component which is wrapped by this first one in Tapestry 4.1?

I have an example:

 

Page html:

<div jwcid="@Component">

            <p>This is top level component's body</p>

</div>

 

Component.jwc:

<div jwcid="$content$">

            <div> Haeder </div>

            

            <div jwcid="@For" source="ognl:somePropArray"
value="ognl:currentProp">

 

<div jwcid="@InnerComponent">

                        <!-- Inner Component presents the body of the top
level component -->

<p>This is top level component's body</p>

<div>

 

</div>

 

<div> Footer </div>

</div>

 

Maybe use of @RenderBody component for @InnerComponent?

 

Thanks for your time,

Marko


RE: Render body of the component in some other component

Posted by Marko Mrkus <ma...@bumblehood.com>.
Thanks, I just wanted to make sure that this component is the right tool for
the job!

My job is to build Pagination component which will use filter and pages for
rendering component which is wrapped by Pagination component.

Sample usage could be:
<div jwcid="@Pagination" source="ognl:paginationModel"
value="ognl:currentValue">
	<div jwcid="@IteratedComponent" />
</div>

And IteratedComponent must be unaware of PaginationComponent. Template which
InnerComponent could have is:

	<div jwcid="@Insert" value="ognl:currentValue.someProp" />
	<div jwcid="@Insert" value="ognl:currentValue.someOtherProp" />
	...

So it's something similar like @For component but with pagination and
filtering :)


-----Original Message-----
From: andreoua@gmail.com [mailto:andreoua@gmail.com] On Behalf Of Andreas
Andreou
Sent: Friday, August 14, 2009 3:46 PM
To: Tapestry users
Subject: Re: Render body of the component in some other component

use RenderBody instead of InnerComponent

If for every iteration you want to pass dynamic data from @Component
to the components that exist in the body of @Component, you can use
the requestCycle, i.e.
cycle.setAttribute()
cycle.getAttribute()


On Fri, Aug 14, 2009 at 4:27 PM, Marko Mrkus<ma...@bumblehood.com>
wrote:
> Sorry, formatting of the last message was awful... Here's the message
again:
>
> Hi, all!
> Can you tell me is it possible to render body of a component in some other
> component which is wrapped by this first one in Tapestry 4.1?
>
> I have an example:
> Page html:
> <div jwcid="@Component">
>            <p>This is top level component's body</p>
> </div>
>
> Component.jwc:
> <div jwcid="$content$">
>            <div> Haeder </div>
>
>                <div jwcid="@For" source="ognl:somePropArray"
>                        value="ognl:currentProp">
>
>                        <div jwcid="@InnerComponent">
>                        <!-- Inner Component presents the body of the top
> level component -->
>                                <p>This is top level component's body</p>
>                        <div>
>                </div>
>
>                <div> Footer </div>
> </div>
> Maybe use of @RenderBody component for @InnerComponent?
> Thanks for your time,
> Marko
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


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


Re: Render body of the component in some other component

Posted by Andreas Andreou <an...@di.uoa.gr>.
use RenderBody instead of InnerComponent

If for every iteration you want to pass dynamic data from @Component
to the components that exist in the body of @Component, you can use
the requestCycle, i.e.
cycle.setAttribute()
cycle.getAttribute()


On Fri, Aug 14, 2009 at 4:27 PM, Marko Mrkus<ma...@bumblehood.com> wrote:
> Sorry, formatting of the last message was awful... Here's the message again:
>
> Hi, all!
> Can you tell me is it possible to render body of a component in some other
> component which is wrapped by this first one in Tapestry 4.1?
>
> I have an example:
> Page html:
> <div jwcid="@Component">
>            <p>This is top level component's body</p>
> </div>
>
> Component.jwc:
> <div jwcid="$content$">
>            <div> Haeder </div>
>
>                <div jwcid="@For" source="ognl:somePropArray"
>                        value="ognl:currentProp">
>
>                        <div jwcid="@InnerComponent">
>                        <!-- Inner Component presents the body of the top
> level component -->
>                                <p>This is top level component's body</p>
>                        <div>
>                </div>
>
>                <div> Footer </div>
> </div>
> Maybe use of @RenderBody component for @InnerComponent?
> Thanks for your time,
> Marko
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


Re: Render body of the component in some other component

Posted by Richard Kirby <rb...@capdm.com>.
Yes - that is exactly what @RenderBody does.

Cheers

Richard

Marko Mrkus wrote:
> Sorry, formatting of the last message was awful... Here's the message again:
>
> Hi, all!
> Can you tell me is it possible to render body of a component in some other
> component which is wrapped by this first one in Tapestry 4.1?
>
> I have an example:
> Page html:
> <div jwcid="@Component">
>             <p>This is top level component's body</p>
> </div>
>
> Component.jwc:
> <div jwcid="$content$">
>             <div> Haeder </div>            
>             
> 		<div jwcid="@For" source="ognl:somePropArray"
> 			value="ognl:currentProp">
>
> 			<div jwcid="@InnerComponent">
>                         <!-- Inner Component presents the body of the top
> level component -->
> 				<p>This is top level component's body</p>
> 			<div>
> 		</div>
> 		
> 		<div> Footer </div>
> </div>
> Maybe use of @RenderBody component for @InnerComponent?
> Thanks for your time,
> Marko
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>   

-- 

Richard Kirby, Technical Director
Email: rbk@capdm.com

Phone:  0131 477 8629
Fax: 0131 477 8621
Email: enquiries@capdm.com
Website: www.capdm.com
CAPDM Limited     Registered in Scotland: SC168970   VAT: 682 846 983
Registered address: 22 Forth Street, Edinburgh, EH1 3LH, UK
===========================================


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


RE: Render body of the component in some other component

Posted by Marko Mrkus <ma...@bumblehood.com>.
Sorry, formatting of the last message was awful... Here's the message again:

Hi, all!
Can you tell me is it possible to render body of a component in some other
component which is wrapped by this first one in Tapestry 4.1?

I have an example:
Page html:
<div jwcid="@Component">
            <p>This is top level component's body</p>
</div>

Component.jwc:
<div jwcid="$content$">
            <div> Haeder </div>            
            
		<div jwcid="@For" source="ognl:somePropArray"
			value="ognl:currentProp">

			<div jwcid="@InnerComponent">
                        <!-- Inner Component presents the body of the top
level component -->
				<p>This is top level component's body</p>
			<div>
		</div>
		
		<div> Footer </div>
</div>
Maybe use of @RenderBody component for @InnerComponent?
Thanks for your time,
Marko


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