2011-02-11 30 views
0

我有兩個模態面板即面板1和麪板2。加載兩個模態面板的問題

兩個面板負載的同時頁面上,

要求是在是Panel2加載PANEL1。 但是,當頁面加載時,它始終使panel2覆蓋panel1,而不管頁面上模型面板位置的代碼如何。

我使用RichFaces的-3.3.2-SR1版本

代碼放在這裏:

<rich:modalPanel id="panel1" resizeable="false" showWhenRendered="true"> 
    My data goes here 
</rich:modalPanel> 
<rich:modalPanel id="panel2" resizeable="false" showWhenRendered="true"> 
    <center> 
     <h:graphicImage url="image.gif" /> 
    </center> 
</rich:modalPanel> 

注:PANEL1包含圖像

感謝 NIKS

回答

1

嘗試設置z-index屬性

z-index屬性指定元素的堆棧順序 。

堆棧順序較大的元素是 始終位於元素前面,堆棧順序較低的元素爲 。

:z索引僅適用於定位 元件(位置:絕對的, 位置:相對的,或位置是:固定)。

嘗試

<rich:modalPanel id="panel1" resizeable="false" showWhenRendered="true" zindex="2000"> 
    My data goes here 
</rich:modalPanel> 

<rich:modalPanel id="panel2" resizeable="false" showWhenRendered="true" zindex="1000"> 
    <center> 
     <h:graphicImage url="image.gif" /> 
    </center> 
</rich:modalPanel> 
+0

org.life.java - 謝謝你,它的工作原理:)通過這個簡單的CSS來解決它沒有思想。 – niksvp 2011-02-11 10:54:43