You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Apache Wiki <wi...@apache.org> on 2007/08/14 22:18:05 UTC

[Tapestry Wiki] Update of "Tapestry5HowToCreateATabPanel" by DanielJue

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tapestry Wiki" for change notification.

The following page has been changed by DanielJue:
http://wiki.apache.org/tapestry/Tapestry5HowToCreateATabPanel

------------------------------------------------------------------------------
   1. The page is re-rendered, but since the selectedComponent is 'flashed' to persist, during the next rendering, its value is still 2
   1. We now return to the start, but tab2 is returned, and therefore the message will be "tab2".
  
+ === Notes ===
+ Remember that the <t:block> code doesn't have to be located where you would have the instance appear.  A component from that block will only appear when a delegate calls it.  This is the same as in Tapestry 4.  
+ 
+ For example, instead of this:
+ {{{
+ <div id="yui-main">
+ 	<div class="yui-b">
+ 		<div id="mainContent">
+ 			<t:body/>
+ 			<t:delegate to="selectedTab"/>
+ 			<t:block>
+ 				<div t:id="tab1"/>
+ 				<div t:id="tab2"/>
+ 				<div t:id="tab3"/>
+ 			</t:block>
+ 		</div>
+ 	</div>
+ </div>
+ }}}
+ 
+ You could do this, and it will work the same:
+ 
+ {{{
+ <div id="yui-main">
+ 	<div class="yui-b">
+ 		<div id="mainContent">
+ 			<t:body/>
+ 			<t:delegate to="selectedTab"/>
+ 
+ 		</div>
+ 	</div>
+ </div>
+ 
+ <t:block>
+  <div t:id="tab1"/>
+  <div t:id="tab2"/>
+  <div t:id="tab3"/>
+ </t:block>
+ }}}
+ 
+ In fact, you could have all the blocks for your page in the same <t:block> tag, and multiple delegates can pull from this pool of blocks.
+ 
+ It may also be possible to inject blocks in your page class, or pull blocks from other pages, if you really wanted to.
+ 

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