论坛首页 入门技术论坛

请问这是否是Tapestry4的bug

浏览 2064 次
该帖已经被评为新手帖
作者 正文
   发表时间:2006-10-13  
环境:T4
Home.html
<html><body jwcid="@Body">
      <table width="246" border="0" cellpadding="0" cellspacing="0" align="center">
<form jwcid="submitForm"> 
            <tr><td width="219" height="16" valign="top">
       input1<input type="text" name="textfield" jwcid="input1"/>
            </td></tr>
    <tr><td height="23" valign="top">
       <input type="submit" name="Submit2" jwcid="submit1"/>
  </td></tr>
    <tr><td height="21" valign="top">
       <input type="submit" name="Submit22" jwcid="submit2"/>   </td></tr>
    <tr><td height="29" colspan="2" valign="top">
       input2<input type="text" name="textfield22" jwcid="input2"/>   </td></tr>
  </form>
      </table>
</body></html>


Home.page
    <component id="submitForm" type="Form"/>
    <component id="input1" type="TextField">
    <binding name="value" value="input1"/>
    </component>
<component id="input2" type="TextField">
    <binding name="value" value="input2"/>
    </component>

<component id="submit1" type="Submit">
    <binding name="listener" value="listener:submit1"/>
    </component>
<component id="submit2" type="Submit">
    <binding name="listener" value="listener:submit2"/>
    </component>

Home.java
public abstract class Home extends BasePage{

@InjectPage("Home")
public abstract Home getHome();

private String input1;
private String input2;

public String getInput1() {
return input1;
}
public void setInput1(String input1) {
this.input1 = input1;
}
public String getInput2() {
return input2;
}
public void setInput2(String input2) {
this.input2 = input2;
}

public IPage submit1(){
this.setInput2(this.getInput1()+this.getInput2());
return getHome();
}
public IPage submit2(){
this.setInput1(this.getInput1()+this.getInput2());
return getHome();
}
}

运行程序,对input1,input2,submit1,submit2操作如下:
1,在input1中输入1;input2中输入2,如图:
[img]http://yi527.iteye.com/upload/picture/pic/101/2f61954a-bd5e-4089-bc9d-64e95c3c0d15.jpg [/img]
2,点击submit1,得到如下结果:
[img]http://yi527.iteye.com/upload/picture/pic/102/2cebe925-1323-4b58-a7d0-aad952e84083.jpg [/img]
3,重复步骤1, 在input1中输入1;input2中输入2,然后点击submit2,得到如下结果:
[img]http://yi527.iteye.com/upload/picture/pic/103/bd002230-78c2-4c35-b822-d2af74b01188.jpg [/img]
-------------------------------
上述,操作中input2根本没有接受任何参数,但是input1却是正常的,请问这个问题是什么原因造成?是否是bug.
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics