【发布时间】:2016-12-08 11:05:15
【问题描述】:
我的标签 p:commandLink 在 IE8 上无法运行(在 IE8 中运行良好)。
我的 xhtml 是这样的:
<h:head>
<script type="text/javascript">
function show_confirm() {
//<![CDATA[
var conf = confirm('Are you sure you want to delete?');
if (conf == true) {
document.getElementById("scheduleManagerForm:delrow").click();
}
//]]>
}
function run_the_Job_Confirmation() {
//<![CDATA[
var conf = confirm('Are you sure you want to run it now?');
if (conf == true) {
document.getElementById("scheduleManagerForm:runrow").click();
}
//]]>
}
</script>
</h:head>
<body>
<h:form>
<p:dataTable id="jobSchedules" var="js" value="#{SJBean.listOfJobScheduleDTO}"
selectionMode="single" selection="#{SJBean.selectedJobSchedule}"
rowSelectListener="#{SJBean.onRowSelect}"
rowEditListener="#{SJBean.rowEdit}" onRowEditUpdate="jobSchedules msgs">
<p:column style="width:150px;" headerText="Edit">
<p:rowEditor update="scheduleManagerForm:jobListPanel" oncomplete="location.reload()"/>
<p:commandLink styleClass="ui-icon ui-icon-trash" onclick="show_confirm();">
<f:setPropertyActionListener target="#{SJBean.selectedJobSchedule}" value="#{js}" />
</p:commandLink>
<p:commandLink styleClass="ui-icon ui-icon-play" onclick="run_the_Job_Confirmation();"></p:commandLink>
</p:column>
</p:dataTable>
<h:commandButton id="delrow" value="ok" style="visibility:hidden;">
<f:ajax listener="#{SJBean.deleteRow}" render="msgs jobSchedules"></f:ajax>
</h:commandButton>
<h:commandButton id="runrow" value="ok" style="visibility:hidden;">
<f:ajax listener="#{SJBean.runTheJob}" render="msgs"></f:ajax>
</h:commandButton>
</h:form>
</body>
当用户点击删除图标并且 show_confirm() 没有被触发(通过在 firefox 中放置一个调试点来检查)。
相同的代码在 IE 8 中完美执行。 我正在使用 Primefaces 2.2 作为应用程序的组成部分。
【问题讨论】:
-
至少你需要 而不是
标签: javascript jsf primefaces internet-explorer-8