私はJSFページを書いていますが、コマンドボタンはページの読み込み時にそのアクションを何度も呼び出しますが、誰もそれをクリックしませんでした...これは私の全体の進行を台無しにします...
HTML:
<h:panelGrid columns="2" cellpadding="10">
<h:form>
<table>
<tr>
<td>姓名:</td>
<td><p:inplace editor="true"><p:inputText value="#{user.name}"/></p:inplace></td>
</tr>
<tr>
<td>联系方式:</td>
<td><p:inplace editor="true"><p:inputText value="#{user.phone}"/></p:inplace></td>
</tr>
<tr>
<td>性别:</td>
<td><h:outputText value="#{user.gender}"/></td>
</tr>
<tr>
<td>身份证号:</td>
<td><p:inplace editor="true"><p:inputText value="#{user.pid}"/></p:inplace></td>
</tr>
<tr>
<td style="position:absolute; right:30px;"><p:commandButton value="删除" action="#{info.removeUser()}"/></td>
</tr>
</table>
</h:form>
java:
public void removeUser(){
System.out.println("Current tab:"+index +" Removed............");
users.remove(Integer.parseInt(index));
}
ここで、「インデックス」は、文字列であるaccordionPanelの現在のタブです。
ここで質問する最初の時間、多分私はいくつかの情報を省略しました...