【问题标题】:Primefaces p:commandLink not working in above IE8?Primefaces p:commandLink 在 IE8 上不起作用?
【发布时间】: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


【解决方案1】:

我的 javascript 中有一个不可见的字符。它在我的文本编辑器(Eclipse 中的那个)中是不可见的,但是当我在记事本中打开时,我能够看到它。 那是禁止它执行javascript。删除它,现在一切正常。

【讨论】:

    猜你喜欢
    • 2013-08-09
    • 1970-01-01
    • 2014-04-11
    • 1970-01-01
    • 2011-03-07
    • 1970-01-01
    • 2017-06-23
    • 1970-01-01
    • 2012-10-28
    相关资源
    最近更新 更多