[Tapestry4] 初学遇到listener的问题
bill_mouse
2008-10-30
T4.1.6
參照Enjoying Web Development with Tapestry 的例子 在使用implicit components時候,form的listener失效了, click submit的時候沒有調用onOk方法, 請高手指點一下。 編碼如下: quote.html <html jwcid="@Shell" title="Stock Quote"> <body jwcd="@body"> <form jwcid="stockQuoteForm@Form" listener="listener:onOk" > <input type="text" jwcid="stockId@TextField" value="ognl:stockId"/> <input type="submit" value="OK"/> </form> </body> </html> quote.page <?xml version="1.0"?> <!DOCTYPE page-specification PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN" "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd"> <page-specification class="com.best.survendor.web.page.StockQuote"> </page-specification> StockQuote.java public abstract class StockQuote extends BasePage { @InjectPage("quoteResult") public abstract QuoteResult getQuoteResultPage(); @InitialValue("literal:test1") public abstract String getStockId(); public IPage onOk(IRequestCycle cycle) { System.out.println("this is a quote"); QuoteResult page =getQuoteResultPage(); page.setStockValue(getStockId()); return page; } } |
|
wobu20
2008-10-31
<body jwcd="@body">
@InjectPage("quoteResult") public abstract QuoteResult getQuoteResultPage(); |
|
leonhe_cn
2009-02-23
顶楼上的,tapestry组件要大写。
|