Tapestry 和 Wicket 的比较
2010-03-30 00:00:00 来源:WEB开发网Tapestry 提供方便的 Table 组件及其低级别的支持,比如来自 Contrib Library 模块的 TableView,如清单 17、18 所示:
清单 17. Tapestry 页面说明
<component id="receivedItemsView" type="contrib:TableView">
<binding name="source" value="ognl:itemsTableModel"/>
<binding name="columns" value="itemId, subject, creator, recipient"/>
<binding name="pageSize" value="10"/>
</component>
<component id="receivedItemsColumns" type="contrib:TableColumns" />
<component id="receivedItemsRows" type="contrib:TableRows" />
<component id="receivedItemsValues" type="contrib:TableValues" />
<component id="receivedItemsPages" type="contrib:TablePages">
<binding name="pagesDisplayed" value="10"/>
</component>
清单 18. Tapestry 中的 Java 类
public IBasicTableModel getItemsTableModel() {
return new IBasicTableModel() {
public int getRowCount() {
return getActionItemManager().getActionItemsCountByRecipient(uid);
}
public Iterator getCurrentPageRows(int nFirst, int nPageSize,
ITableColumn objSortColumn, boolean bSortOrder) {
return getActionItemManager()
.getActionItemsListByRecipient(uid, nFirst, nPageSize);
}
};
}
更多精彩
赞助商链接