2015-04-22 60 views
0

以下代碼是處理用戶可以關閉的命令時出現的對話框。它適用於IE,但Chrome和Firefox不允許在運行後解散。jsp函數可以在IE中使用,但不適用於Chrome或Firefox。

<a4j:status id="statusWaitInt" forceId="true" 
      onstart="javascript:Richfaces.showModalPanel('waitModalPanel2');" 
      onstop="javascript:Richfaces.hideModalPanel('waitModalPanel2');"> 
    </a4j:status> 
    <rich:modalPanel id="waitModalPanel2" autosized="true" width="200" height="50" resizeable="false"> 
      <f:facet name="header"> 
       <h:panelGrid columns="2" width="100%"> 
        <h:outputText value="IWS Processing..." styleClass="textLabel"/>    
        <h:graphicImage value="/images/close.jpg" style="cursor:pointer;float:right;" onclick="Richfaces.hideModalPanel('waitModalPanel2')" /> 
       </h:panelGrid> 
      </f:facet> 
      <h:panelGrid style="margin:auto"> 
       <rich:spacer height="5px"/> 
       <h:graphicImage value="/images/ajax-loader1.gif"/> 
      </h:panelGrid> 
    </rich:modalPanel> 

這裏是正在從它產生的HTML:

</head><span id="waitStatus"><span id="waitStatus.start" style="display: none"></span><script type="text/javascript"> 
    window.document.getElementById('waitStatus.start').onstart=function(){javascript:Richfaces.showModalPanel('waitModalPanel');;}; 
</script><span id="waitStatus.stop"></span><script type="text/javascript"> 
    window.document.getElementById('waitStatus.stop').onstop=function(){javascript:Richfaces.hideModalPanel('waitModalPanel');;}; 
</script></span><div id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanel" style="display: none;"><input autocomplete="off" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelOpenedState" name="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelOpenedState" type="hidden" /><div class="rich-modalpanel " id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelContainer" style="position: absolute; display: none; z-index: 100; background-color: inherit;"><div class="rich-mpnl-mask-div-opaque rich-mpnl-mask-div" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelDiv" style="z-index: -1;"><button class="rich-mpnl-button" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelFirstHref"></button></div><div class="rich-mpnl-panel"><div class="rich-mp-container" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelCDiv" style="position: absolute; left: 0px; top: 0px; z-index: 9;"><div class="rich-mpnl-shadow" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelShadowDiv"></div><div class=" rich-mpnl-content" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelContentDiv"><table border="0" cellpadding="0" cellspacing="0" class="rich-mp-content-table" id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelContentTable" style="width: 200px;height: 50px;"><tr style="height: 1%;"><td class="rich-mpnl-header-cell"><div class="rich-mpnl-text rich-mpnl-header " id="pbG182563ee_2d855a_2d4d65_2d8443_2d55f7fefd57c7:_viewRoot:j_id0:waitModalPanelHeader" style="white-space: nowrap;"><table width="100%"> 
<tbody> 
<tr> 
    <td><span class="textLabel">IWS Processing...</span></td> 
<td><img src="/iws-vault/images/close.jpg" onclick="Richfaces.hideModalPanel('waitModalPanel');" style="cursor:pointer;float:right;" /></td> 
+1

什麼是生成的HTML是什麼樣子? – ShadowCat7

+0

@ ShadowCat7是一個彈出框,X在右上角消失。圖形圖像是X – user3108923

+0

我的意思是你可以在你的問題中提供生成的HTML/JavaScript?問題可能在那裏。 – ShadowCat7

回答

0

拇指與彈出面板的規則是,他們應該被放置在<h:form/>從他們就會被觸發之外。然後彈出式面板可以包含它自己的<h:form/>

要發言,你的具體問題,RichFaces的3.X爲有錢人制作特殊的讓步:modalPanel,是在IE中使用。從the doc

爲了避免IE中的錯誤,對話框的根節點移動到DOM樹頂部。

你也應該知道,根據布萊恩Leathem(RichFaces的鉛)RF 3.x is compatible only with IE <= 8

+0

所以我最好的辦法是升級我的RichFace庫?另外,你是怎麼知道我正在運行3.x的? – user3108923

+0

對不起,我是Richfaces平臺的新手。 – user3108923

+0

對不起,忘了標記你 – user3108923

相關問題