【发布时间】:2013-07-28 20:34:48
【问题描述】:
在以下代码中,我默认禁用命令按钮并在输入发生任何更改后启用。
按钮启用正常,但是,
按钮启用时不调用按钮的操作方法[reconfirmAction()],使用客户端API方法
button_widget.enable()
代码如下:
<h:form id="reConfirmForm">
<h:outputLabel>User Name</h:outputLabel>
<h:inputText value="#{myBean.userName}" onchange="btnWigetVar.enable()"/><br/>
<h:outputLabel>Email</h:outputLabel>
<h:inputText value="#{myBean.userEmail}" onchange="btnWigetVar.enable()"/><br/>
<p:commandButton value="Re-Confirm" widgetVar="btnWigetVar" action="#{myBean.reconfirmAction}" disabled="true"/>
</h:form>
我正在使用 Primeface 3.5 和 Mojarra 2.1.13
【问题讨论】:
-
最好在窗口加载时禁用
<p:commandButton>,而不是使用disabled="true"。 -
@LuiggiMendoza : 我也试过了,没用。
标签: jsf jsf-2 primefaces