2012-02-06 45 views
5

几天前我在primefaces论坛问1个问题,但没有人回复我。primefaces菜单不能完全显示在全页面布局

我在使用全页面布局(位置=“西”)时遇到问题,子菜单无法完全显示出来。 因为我不想增加西部布局的宽度,可以使它与(位置=“中心”)重叠显示?

下面链接atatch与图片作为参考。

http://www.imagebucket.net/bucket/is.php?i=10434&img=image.jpg

这部分代码:

<p:layoutUnit position="west" size="200" > 
    <ui:insert name="sideBar">       
    <h:form> 
     <p:menu type="tiered" > 
     <p:submenu label="Sales" >          
      <p:menuitem disabled="#{user.customer}" value="Approve" url="/sales/approve.jsf" style="width:50px" />             
     </p:submenu> 
     <p:separator /> 
     <p:submenu label="Customer"> 
      <p:menuitem disabled="#{user.sales}" value="customer" url="/customer/customer.jsf" style="width:50px" /> 
     </p:submenu> 
     </p:menu> 
    </h:form>   
    </ui:insert> 
</p:layoutUnit> 

我刚刚更新primefaces到3.1,并发现有1个功能overlayPanel,我可以知道它是否可以用来解决我的问题?

在此先感谢..

[Eclipse的靛蓝,Tomcat的7,Java EE 6的,PrimeFaces 3.1,钻嘴鱼科2.0.3]

+0

这不是一个答案,但只是一些信息。默认情况下,当submenu DOM元素为'display:none'时,其内联样式为'z-index:1001'设置,但是当它从Javascript悬停事件设置为'display:block'时,同样的事件是也增加了'z-index:1018'。这个问题是,即使你设置了内联样式,它可能会被Primefaces javascripts覆盖。但即使如此,我不认为z-index是原因,因为中央面板的z-index通常默认设置为1。这当然不会看起来像一个简单的问题。 – 2012-02-06 12:29:02

回答

9

终于得到回复的人我的帖子在论坛primefaces。
它解决了我的问题。
这里是链接:
http://forum.primefaces.org/viewtopic.php?f=3&t=18033&p=56425#p56425

更新:
答案:一些CSS技巧就能解决这个问题,只是改变溢出和z-index属性。
附上答案代码如下:

<h:head> 
<style> 
    #leftPanel {z-index:2 !important; } 
    #leftPanel div{overflow:visible;} 
</style> 
</h:head> 

<p:layoutUnit position="west" size="200" id="leftPanel"> 
    <ui:insert name="sideBar">       
    <h:form> 
     <p:menu type="tiered" > 
     <p:submenu label="Sales" >          
      <p:menuitem disabled="#{user.customer}" value="Approve" url="/sales/approve.jsf" style="width:50px" />             
     </p:submenu> 
     <p:separator /> 
     <p:submenu label="Customer"> 
      <p:menuitem disabled="#{user.sales}" value="customer" url="/customer/customer.jsf" style="width:50px" /> 
     </p:submenu> 
     </p:menu> 
    </h:form>   
    </ui:insert> 
</p:layoutUnit>