刚刚解决了壹個细小的技术问题,用 PrimeFaces 4.0 的 UI 组件完成界面元素的开发,XHTML 页面上共有三個按钮,id 分别为 verifyButton、viewButton、downloadButton,其中页面初始化时,verifyButton 处于激活状态(enable),viewButton 和 downloadButton 处于未激活状态(disable),当点击 verifyButton 之后,页面会向后台 Controller 发送 ajax 请求,然后在完成壹些业务逻辑之后返回页面,并将 viewButton 和 downloadButton 激活,此时三個按钮均处于可点击状态。页面部分源代码如下所示:
<h:form id="verificationForm">
<div class="button-padding right mt10">
<p:commandButton id="verifyButton" value="校验" update="@this"
widgetVar="verifyButton"
disabled="#{!batchVerificationMB.enabledVerifyButton()}"
process="@this batchVerificationTable"
actionListener="#{batchVerificationMB.verify()}"
oncomplete="validationUtil.handleAjaxResponse(args, displayErrorMessagesBathVeri