我有一个完整的页面布局。顶部 layoutUnit 有一个菜单和 selectOneMenu。菜单项未正确显示。菜单项与 selectOneMenus 重叠。
这是我使用的 xhtml 代码和样式。
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui">
<h:head>
<style type="text/css">
.ui-widget {
font-size: 12px !important;
}
**.ui-layout-north {
z-index: 20 !important;
overflow: visible !important;
}
.ui-layout-north .ui-layout-unit-content {
overflow: visible !important;
}**
</style>
</h:head>
<h:body>
<p:layout fullPage="true" id="layout1">
<p:layoutUnit id="top" position="north" size="104">
<h:form>
<p:menubar autoSubmenuDisplay="true" id="menubar1">
</p:menubar>
<h:panelGroup id="t1">
<p:toolbar rendered="#{menuBean.renderP1}" id="toolbar1">
<p:toolbarGroup align="left">
<p:selectOneMenu id="prod" value="#{menuBean.product}"
style="width:155px;" required="true"
requiredMessage="Select a product">
<f:selectItem itemLabel="Select product" itemValue="" />
<f:selectItems value="#{menuBean.products}" />
<!-- Product changed -->
<p:ajax event="change" update="prodVar,brkType,brkRevision"
listener="#{menuBean.productChanged}" />
</p:selectOneMenu>
<p:spacer width="50" height="10" />
<p:selectOneMenu id="prodVar" value="#{menuBean.productVariant}"
style="width:165px;" required="true"
requiredMessage="Select product variant">
<f:selectItem itemLabel="Select Variant" itemValue="" />
<f:selectItems value="#{menuBean.productVariants}" />
<!-- productVariant changed -->
<p:ajax event="change" update="brkType,brkRevision"
listener="#{menuBean.productVariantChanged}" />
</p:selectOneMenu>
</p:toolbarGroup>
</p:toolbar>
</h:panelGroup>
</h:form>
</p:layoutUnit>
<p:layoutUnit id="center" position="center">
<h:form id="form2">
<h:panelGroup id="t2">
<p:tabView id="tabView" rendered="#{menuBean.renderP2}">
</h:panelGrid>
</p:tab>
</p:tabView>
</h:panelGroup>
</h:form>
</p:layoutUnit>
</p:layout>
</h:body>
</html>