我的代码如下所示,
<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 对吗?
但它不一样......有什么理由吗?