问题是我的菜单总是位于中心 Pane 下方,我不知道如何解决这个问题。我尝试更改 css,但是当更改 pe-layout-pane-content 溢出值时,滚动条不再可见,如果没有它,pe-north 中的 z-index 根本没有帮助。这让我发疯,因为它过去在使用 p:layout 和 css-changes 时有效。
我只有这样的模板:
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h:outputStylesheet library="css" name="global.css"/>
<style type="text/css">
.noBorders tr, .noBorders td {
background: none !important;
border: none !important;
}
</style>
</h:head>
<h:body>
<pe:layout fullPage="true" >
<pe:layoutPane position="north" size="50" resizable="false" closable="false" spacing="0" rendered="true" >
<ui:insert name="north">
<ui:include src="/resources/templates/menuBar.xhtml"/>
</ui:insert>
</pe:layoutPane>
<pe:layoutPane position="west" size="215" resizable="true" closable="true" spacing="-3">
<ui:insert name="west">
</ui:insert>
</pe:layoutPane>
<pe:layoutPane position="east" size="200" resizable="true" closable="true" spacing="-4" >
<ui:insert name="east">
<ui:include src="/resources/templates/commonRight.xhtml"/>
</ui:insert>
</pe:layoutPane>
<pe:layoutPane position="center" size="800" resizable="false">
<h2>
<ui:insert name="title">Default Title</ui:insert>
</h2>
<ui:insert name="center">
Center from newTemplate
</ui:insert>
</pe:layoutPane>
<pe:layoutPane position="south" rendered="false" statusbar="false" size="60" resizable="true" closable="true" spacing="0">
<ui:insert name="south">
<ui:include src="/resources/templates/commonFooter.xhtml"/>
</ui:insert>
</pe:layoutPane>
</pe:layout>
</h:body>
然后我的menuBar.xhtml是这样的:
<h:head>
<title>menuBar.xhtml</title>
</h:head>
<h:body>
<ui:composition>
<h:form>
<p:menubar rendered="true" style="border: none; z-index: 9998; overflow: visible" >
<p:submenu label="#{bundle.menuBar_partners}" icon="ui-icon-document">
<p:menuitem value="#{bundle.menuBar_partners_info}" url="#"/>
<p:submenu label="cars" icon="ui-icon-contact" >
<p:menuitem value="www.rangerover.com" url="http://www.rangerover.com"/>
<p:menuitem value="www.lada.com" url="www.lada.com"/>
</p:submenu>
</p:submenu>
</p:menubar>
</h:form>
</ui:composition>
</h:body>
如果有人知道如何解决这个问题,我将非常非常感激。 萨米人
最佳答案
当我将此 CSS 与常规 primefaces 布局和布局单元一起使用时,溢出对于我的北菜单效果很好,但当我将相同的 CSS 与 pe 布局和 layoutPane 一起使用时,则不然。
.ui-layout-north {
z-index:40 !important;
overflow:visible !important;
}
.ui-layout-north .ui-layout-unit-content {
overflow:visible !important;
}
也许您现在可以切换到 p 布局和布局单元,因为 primefaces 扩展似乎已经打破了 CSS 的溢出。
此外,使用 pe 时,我的北菜单右侧会出现一个愚蠢的滚动条,但使用 p 时却不会。
而且,如果 Oleg 能够为我们提供一个 CSS 解决方案(如果有的话),并在他的更新修复此问题时及时通知我们,那就太好了。
关于jsf - 如何在具有全页布局的 Primefaces Extension 中实现菜单溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11049101/