【发布时间】:2012-07-12 08:54:51
【问题描述】:
我的代码如下,
<a4j:commandLink oncomplete="openSignatureModel();" id="requestText" reRender="sigPassword" title="Send Prescription"
actionListener="#{patientNotePresBackingBean.sendPrescriptionId}"
onclick="return pharmacyCheck('#{row}');">
<f:param name="sendPrescriptionId" value="#{patientNotePrescriptionVar.id}" />
<f:param name="processOfPrescription" value="Send" />
<h:graphicImage value="/images/send-prescribe.png" style="border:0;"></h:graphicImage>
</a4j:commandLink>
而我的 java 脚本就像...
function pharmacyCheck(rowID) {
var a = document.getElementById("prescriptionId:patientNotePresListId:"+rowID+":pharmacyRcopiaId");
if(a.value == -1) {
alert("Please select Pharmacy");
return false;
} else {
return true;
}
}
实际上,当它返回 true 时,它应该调用 patientNotePresBackingBean.sendPrescriptionId 对吗?
但它的调用不一样....有什么原因吗?
【问题讨论】:
-
这可能是使用
actionListenerIIRC 需要一个特殊的方法签名。你为什么不改用action="..."? -
看我的回答,我以前遇到过你的问题,这就是我找到的解决方案。