2014-02-05 15 views
2

我在一個頁面中使用Primefaces p:dialogmodal=truep:media
的Internet Explorer(所有版本)有問題:Primefaces模態對話框正在IE媒體組件下方

  • p:dialog的模態不隱藏p:media
  • p:dialog會背後/的p:media組件的下方時,對話框顯示出來。

請爲此提供任何解決方案或JQuery解決方法。
下面是代碼和截圖:

<div id="myPdfMedia"> 
    <p:media value="/resources/myfiles/primefaces_users_guide_3_5.pdf" width="500px" height="300px"> 
    Your browser can't display pdf, <h:outputLink value="/resources/myfiles/primefaces_users_guide_3_5.pdf">click</h:outputLink> to download pdf instead. 
    </p:media> 
</div> 

<p:commandButton onclick="dlg.show()" value="Dialog"/> 

<p:dialog widgetVar="dlg" modal="true" appendToBody="true" width="200px" height="100px" header="My Dialog" > 
    This is the dialog 
</p:dialog> 

enter image description here

注:使用Primeface 3.5和JSF 2.1.13

回答

-1

嘗試使用類似的風格=「Z-Z-index屬性索引:高於媒體Z索引的任何值「。
如果你想讓它適用於所有對話框,然後把CSS代碼一樣

.ui-dialog{z-index:1005 !important;} 

希望這有助於

+0

沒有。 –

+0

您是否嘗試設置對話框的z-index大於媒體的z-index。並且可以嘗試在媒體上放置對話。 –

2

我利用primefaces擴展名改爲的DocumentViewer從媒體解決primefaces問題。

使用此:

<pe:documentViewer locale="pt" height="#{previewHeight}" value="#{previewComponent.file}"> 
         #{text['error.documentviewer']} 
</pe:documentViewer> 

,而不是這樣的:這不是幫助

<p:media value="#{previewComponent.file}" height="#{previewHeight}" width="100%" player="pdf" cache="false"> 
         #{text['error.documentviewer']} 
</p:media>