第二十三講:tapestry的Delegate和Blocks組件

源碼以下:html

DelegateAndBlocks.javajava

/**
* 項目名稱:TapestryStart
* 開發模式:Maven+Tapestry5.x+Tapestry-hibernate+Mysql
* 版本:1.0
* 編寫:飛風
* 時間:2012-02-29
*/
package com.tapestry.app.pages;
 
public class DelegateAndBlocks {
 
}
 

DelegateAndBlocks.tmlsql

<html t:type="layout" title="tapestryStart Index"  t:sidebarTitle="Framework Version"
 xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd" xmlns:p="tapestry:parameter">
<t:delegate to="block:blockA"/>
<t:delegate to="block:blockB"/>
<t:delegate to="block:blockC"/>
<t:delegate to="block:blockB"/>
<t:delegate to="block:blockA"/> <br/>
<t:block id="blockA">
<div style="margin: 2px; padding: 10px; background-color: #f8f8f8;">
This is block A.
</div>
</t:block>
<t:block id="blockB">
<div style="margin: 2px; padding: 10px; background-color: #f0f0f0;">
This is block B.
</div>
</t:block>
<t:block id="blockC">
<div style="margin: 2px; padding: 10px; background-color: #e8e8e8;">
This is block C.
</div>
</t:block>
 </html>

http://localhost/delegateAndBlock/DelegateAndBlocks
相關文章
相關標籤/搜索