加载两个模态面板时出现问题

时间:2011-02-11 10:35:53

标签: java html css jsf richfaces

我有两个模态面板,即panel1和panel2。

两个面板同时在页面上加载

要求是在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 个答案:

答案 0 :(得分:1)

尝试设置z-index属性

  

z-index属性指定   堆栈元素的顺序。

     

具有更多堆栈顺序的元素是   总是在一个元素的前面   降低堆栈顺序。

     

注意:z-index仅适用于定位   元素(位置:绝对,   position:relative,或position:fixed)。

尝试

<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>