我有两个按钮:
<a4j:commandButton execute="@this" value="clear" immediate="true" render=":thisForm :anotherForm" action="#{myMB.clearFields}" /> <a4j:commandButton value="execute" type="submit" action="#{myMB.executeAction}" render=":anotherForm" />
两个都使用type=“submit”生成输入。但我想要执行第二个按钮的键。有没有办法更改第一个按钮的类型?
<a4j:commandButton type="button" .../>
按第一个按钮就可以了。
类型 -要创建的按钮类型。可以是“提交”、“按钮”、“图像”和“重置”之一。如果未指定,默认值为“提交”。
提到 component reference 更多细节。