几天前,我在 primefaces 论坛上问了 1 个问题,但没有人回复我。
我在整页布局(position="west") 中使用时遇到问题,子菜单无法完全显示。
可以让它显示与 (position="center") 重叠,因为我不想增加西方布局的宽度?
下面的链接附上一张图片作为引用。
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 Indigo、tomcat 7、Java EE 6、PrimeFaces 3.1、Mojarra 2.0.3]
最佳答案
终于有人在 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>
关于layout - primefaces 菜单无法在整页布局中完全显示出来,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9157327/