You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in Nashua <kc...@live.com> on 2013/05/20 00:36:52 UTC

best way to integrate a page or component to keep modular

Hi Folks,

I have seen some templates grow are large and cluttered.
I am trying to avoid such growth.

Can someone list the components at hand to use to prevent this or to be used to maintain maximum modularity?

Is there a preferred tapestry component or best practice way to keep tml and java files small and modular ?

For example... I have a layout that specifies several blocks 

        <t:block t:id="tab2">    
            <h3>PPHL A League</h3>
            <hr/>        
            <t:jquery.tabs t:listTabData="prop:ALevel" t:activePanelId="aLevelTabsIndex" >
                <t:block t:id="tab00">    <!-- begin block tab3 -->
                    <h3>add INFORMATION description here</h3>
                    <hr/>            
                </t:block>                
                
                <t:block t:id="tab01">
                    <h3>ROSTERS please select a team</h3>
                    <hr/>        
...

I could cut and paste whole pages into these blocks...
or I could refer to a page or component?

Does anyone know what the best practice to do this is ?

I know there are a few ways for components/pages... back in my struts days I use to operate a "target=" construct just to point the rendering to a page and I would know for sure it would get rendered in my spot.

Just curious and a bit wishy washy not sure which one would be best suited.

I try to compose things together but still unsure if its the best way or not.

I prefer to keep code modularized as much as possible.

Thanks for your assistance.
Ken

 		 	   		  

Re: best way to integrate a page or component to keep modular

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 20 May 2013 10:47:06 -0300, Ben Titmarsh  
<be...@hotmail.co.uk> wrote:

> Sounds like what you want is a layout component which uses t:body.

Just a reminder that any component can use <t:body> and that a Layout  
component is something like a design patter in Tapestry, as all components  
are treated in the exact same way.

-- 
Thiago H. de Paula Figueiredo

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


RE: best way to integrate a page or component to keep modular

Posted by Ben Titmarsh <be...@hotmail.co.uk>.
Sounds like what you want is a layout component which uses t:body. 

For example:

Layout.tml

<t:jquery.tabs t:listTabData="prop:ALevel" t:activePanelId="aLevelTabsIndex" >
<t:block t:id="tab00">    <!-- begin block tab3 -->
<h3>add INFORMATION description here</h3>
<hr/>             
</t:block>                

<t:block t:id="tab01">
<h3>ROSTERS please select a team</h3>
<hr/>        

<t:body/>
</t:block>

MyPage.tml

<t:layout ...>
     Page content
</t:layout>

This page provides further documentation:

http://tapestry.apache.org/layout-component.html

> From: kcolassi@live.com
> To: users@tapestry.apache.org
> Subject: RE: best way to integrate a page or component to keep modular
> Date: Sun, 19 May 2013 21:02:54 -0400
> 
> For instance... given this block of code.. 
> 
>             <t:jquery.tabs t:listTabData="prop:ALevel" t:activePanelId="aLevelTabsIndex" >
>                 <t:block t:id="tab00">    <!-- begin block tab3 -->
>                     <h3>add INFORMATION description here</h3>
>                     <hr/>            
>                 </t:block>                
>                 
>                 <t:block t:id="tab01">
>                     <h3>ROSTERS please select a team</h3>
>                     <hr/>        
> 
>                     <t:renderthispagerighthereinplace page="rosterQueryPage" />
>                 </t:block>
> 
> is there such a component that will do the above renderthispagerighthereinplace
> ?
> 
> Thanks
>  		 	   		  
 		 	   		  

RE: best way to integrate a page or component to keep modular

Posted by Ken in Nashua <kc...@live.com>.
For instance... given this block of code.. 

            <t:jquery.tabs t:listTabData="prop:ALevel" t:activePanelId="aLevelTabsIndex" >
                <t:block t:id="tab00">    <!-- begin block tab3 -->
                    <h3>add INFORMATION description here</h3>
                    <hr/>            
                </t:block>                
                
                <t:block t:id="tab01">
                    <h3>ROSTERS please select a team</h3>
                    <hr/>        

                    <t:renderthispagerighthereinplace page="rosterQueryPage" />
                </t:block>

is there such a component that will do the above renderthispagerighthereinplace
?

Thanks