You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Paul Tongyoo <Pa...@fox.com> on 2006/06/30 02:19:09 UTC

Is it possible to "swap components"?

Hello all!

 

I'd like to define a generic "component placeholder" that does not have any
specific type at compile time.  Something like:

 

<span jwcid="@ComponentContainer" component="ognl:someComponent>Component
Placeholder</span>

 

All the ComponentContainer would do is render the component that it's
passed...

 

<component-specification>

            <parameter name="component" required="yes" />

            

            <!-I do NOT want to specify the 'type' attribute here because it
can vary -->

<component id="ComponentDisplay" property="component" />

</component-specification>

 

ComponentContainer.HTML:  <span jwcid="ComponentDisplay">Component displays
Here</span>

 

However Tapestry complains that the type of component isn't specified in the
ComponentContainer.jwc.  I also cannot pass an OGNL expression as the 'type'
attribute value.  Has anyone tried doing something similar - essentially
swapping different components into a component placeholder at runtime?

 

Thanks all for advice!

 

Paul

 


RE: Is it possible to "swap components"?

Posted by James Carman <ja...@carmanconsulting.com>.
Can't you use Block/RenderBlock for this?

-----Original Message-----
From: Mark Stang [mailto:mstang@pingidentity.com] 
Sent: Friday, June 30, 2006 12:29 PM
To: Tapestry users; users@tapestry.apache.org
Subject: RE: Is it possible to "swap components"?

Paul,
We use a technique where we have a component that renders components
dynamically.  Basically, we put them all in a "page" that is never
displayed.  Then at runtime, we dynamically render a particular component.

regards,

Mark


-----Original Message-----
From: Paul Tongyoo [mailto:Paul.Tongyoo@fox.com]
Sent: Thu 6/29/2006 6:19 PM
To: users@tapestry.apache.org
Subject: Is it possible to "swap components"?
 
Hello all!

 

I'd like to define a generic "component placeholder" that does not have any
specific type at compile time.  Something like:

 

<span jwcid="@ComponentContainer" component="ognl:someComponent>Component
Placeholder</span>

 

All the ComponentContainer would do is render the component that it's
passed...

 

<component-specification>

            <parameter name="component" required="yes" />

            

            <!-I do NOT want to specify the 'type' attribute here because it
can vary -->

<component id="ComponentDisplay" property="component" />

</component-specification>

 

ComponentContainer.HTML:  <span jwcid="ComponentDisplay">Component displays
Here</span>

 

However Tapestry complains that the type of component isn't specified in the
ComponentContainer.jwc.  I also cannot pass an OGNL expression as the 'type'
attribute value.  Has anyone tried doing something similar - essentially
swapping different components into a component placeholder at runtime?

 

Thanks all for advice!

 

Paul

 





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


RE: Is it possible to "swap components"?

Posted by Mark Stang <ms...@pingidentity.com>.
Paul,
We use a technique where we have a component that renders components dynamically.  Basically, we put them all in a "page" that is never displayed.  Then at runtime, we dynamically render a particular component.

regards,

Mark


-----Original Message-----
From: Paul Tongyoo [mailto:Paul.Tongyoo@fox.com]
Sent: Thu 6/29/2006 6:19 PM
To: users@tapestry.apache.org
Subject: Is it possible to "swap components"?
 
Hello all!

 

I'd like to define a generic "component placeholder" that does not have any
specific type at compile time.  Something like:

 

<span jwcid="@ComponentContainer" component="ognl:someComponent>Component
Placeholder</span>

 

All the ComponentContainer would do is render the component that it's
passed...

 

<component-specification>

            <parameter name="component" required="yes" />

            

            <!-I do NOT want to specify the 'type' attribute here because it
can vary -->

<component id="ComponentDisplay" property="component" />

</component-specification>

 

ComponentContainer.HTML:  <span jwcid="ComponentDisplay">Component displays
Here</span>

 

However Tapestry complains that the type of component isn't specified in the
ComponentContainer.jwc.  I also cannot pass an OGNL expression as the 'type'
attribute value.  Has anyone tried doing something similar - essentially
swapping different components into a component placeholder at runtime?

 

Thanks all for advice!

 

Paul

 



Re: Is it possible to "swap components"?

Posted by Jesse Kuhnert <jk...@gmail.com>.
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/RenderBlock.html

On 6/29/06, Paul Tongyoo <Pa...@fox.com> wrote:
>
> Hello all!
>
>
>
> I'd like to define a generic "component placeholder" that does not have
> any
> specific type at compile time.  Something like:
>
>
>
> <span jwcid="@ComponentContainer" component="ognl:someComponent>Component
> Placeholder</span>
>
>
>
> All the ComponentContainer would do is render the component that it's
> passed...
>
>
>
> <component-specification>
>
>             <parameter name="component" required="yes" />
>
>
>
>             <!-I do NOT want to specify the 'type' attribute here because
> it
> can vary -->
>
> <component id="ComponentDisplay" property="component" />
>
> </component-specification>
>
>
>
> ComponentContainer.HTML:  <span jwcid="ComponentDisplay">Component
> displays
> Here</span>
>
>
>
> However Tapestry complains that the type of component isn't specified in
> the
> ComponentContainer.jwc.  I also cannot pass an OGNL expression as the
> 'type'
> attribute value.  Has anyone tried doing something similar - essentially
> swapping different components into a component placeholder at runtime?
>
>
>
> Thanks all for advice!
>
>
>
> Paul
>
>
>
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.