[Tapestry5] tapestry5,同一个form两个提交按钮的提交问题。

hongyuzhe 2008-01-31
假如我有只有一个Form
<t:form>
<input t:type="submit" t:id="search1" />
<input t:type="submit" t:id="search2" />
</t:form>

@InjectPage
private TargetPage targetpage;

@InjectPage
private ResultPage resultpage;
Object onSuccess(){
        targetpage.setId("1");
        return targetpage;
}
这时候,无论点击那一个按钮都会触发onSuccess()事件。我想点击search1的时候targetpage.setId("1");然后return targetpage;跳转到targetpage 页面。点击search2的时候resultpage.setId("1");然后return resultpage;跳转到resultpage页面。
请问怎么做。
tapestry 2008-01-31
不好意思,没看到是T5的,java类中定义两个方法
onActionFromSearch1
onActionFromSearch2
Global site tag (gtag.js) - Google Analytics