Primefaces菜单栏无法正确渲染

时间:2014-05-16 18:16:44

标签: primefaces submenu

我在使用layoutunit渲染页面时遇到问题,其中顶部layoutunit有一个菜单栏,菜单项很少。 它在浏览器中无法正确呈现。请参阅附页的预期页面和实际页面 早些时候,它在Chrome中正常渲染,但在Firefox和IE中却没有。但是,现在它没有在任何浏览器中按预期呈现

主layout.xhtml

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:p="http://primefaces.org/ui">
    <f:view contentType="text/html">
        <h:head>
            <f:facet name="first">
                <title>SAMPLE</title>
            </f:facet>
            <ui:insert name="head"></ui:insert>
            <link type="text/css" rel="stylesheet"
                href="#{request.contextPath}/resources/themes/overcast/overcast.css"></link>
            <link type="text/css" rel="stylesheet"
                href="#{request.contextPath}/resources/style/my-style.css"></link>
        </h:head>
        <h:body>
            <p:layout fullPage="true">
                <p:ajax event="toggle" listener="#{layoutBean.handleToggle}" />
                <p:ajax event="close" listener="#{layoutBean.handleClose}" />
                <p:layoutUnit position="north" size="100" header="Track-!T"
                    resizable="true" closable="true" collapsible="true"
                    id="top">
                    <h:form id="topform">
                        <ui:include src="main-menu-bar.xhtml" />
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit position="south" size="100" header="Bottom"
                    resizable="true" closable="true" collapsible="true"
                    id="bottom">
                    <h:form id="bottomform">
                        <h:outputText value="South unit content." />
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit position="west" size="200" header="Left"
                    resizable="true" closable="true" collapsible="true"
                    id="left">
                    <h:form id="leftform">
                        <ui:insert name="side-menu-bar" />
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit position="east" size="200" header="Right"
                    resizable="true" closable="true" collapsible="true" id="right"
                    style="height:auto">
                    <h:form id="rightform">
                        <ui:insert name="rightPanel" />
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit position="center" id="center">
                    <p:messages id="messages" showDetail="true" autoUpdate="true"
                        closable="true" />
                    <h:form id="myform">
                        <ui:insert name="content" />
                    </h:form>
                </p:layoutUnit>
            </p:layout>
        </h:body>
    </f:view>
</ui:composition>

主菜单bar.xhtml

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
    <p:menubar id="mainmenubar">
        <p:submenu label="File" icon="ui-icon-note" id="filemenu">
            <p:menuitem value="Customer" />
            <p:menuitem value="Enquiry" />
            <p:menuitem value="Job" />
            <p:menuitem value="Agent"
                action="#{agentController.renderCreateAgentForm}" process="filemenu" />
        </p:submenu>
        <p:submenu label="Tools" icon="ui-icon-wrench">
            <p:menuitem value="Back-up Data" />
            <p:menuitem value="Restore Data" />
        </p:submenu>
        <p:submenu label="Settings" icon="ui-icon-gear">
            <p:menuitem value="Register Product" />
            <p:menuitem value="Master Data"
                action="#{countryRegionController.renderCreateCountryRegionForm}" />
        </p:submenu>
        <p:submenu label="Help" icon="ui-icon-help">
            <p:menuitem value="Project" />
            <p:menuitem value="Other" />
        </p:submenu>
        <p:submenu label="Quit" icon="ui-icon-power">
            <p:submenu label="Customer" icon="ui-icon-contact">
                <p:menuitem value="Project" />
                <p:menuitem value="Other" />
            </p:submenu>
            <p:menuitem value="Open" />
            <p:separator />
            <p:menuitem value="Quit" />
        </p:submenu>
        <f:facet name="options">
            <p:inputText style="margin-right:10px" />
            <p:commandButton type="button" value="Logout" />
        </f:facet>
    </p:menubar>
</ui:composition>

Properly Rendered- expected

Not rendered properly-actual

请在这里发短信可能是问题和解决方案..谢谢

0 个答案:

没有答案