【发布时间】:2013-12-18 04:52:49
【问题描述】:
我有一个名为 mwnubar.xhtml 的 xhtml 页面。有p:menuBar。当我
单击 p:menuitem ,它正在导航到一个页面。当页面加载时,我同时从一个页面传递到另一个页面,它显示为空页面,我想要点击p:menuitem
它必须显示 ajaxStatus 并带有消息“页面正在加载,请稍候”。如何使用 menuBar 显示消息“页面正在加载,请稍候”?
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<f:view contentType="text/html" beforePhase="#{loginView.checkLogin}">
<p:ajaxStatus onstart="statusDialog.show();" oncomplete="statusDialog.hide();"/>
<p:dialog modal="true" widgetVar="statusDialog" resizable="false" position="center" header="Page is loading..Please wait" width="250" draggable="false" closable="false">
</p:dialog>
<h:head>
</h:head>
<h:body >
<h:form id="menuForm">
<p:menubar autoDisplay="true" >
<p:menuitem value="homepage" icon="dt dt18"
url="index.jsf" />
<p:submenu label="user actions" icon="dt dt01">
<p:menuitem value="define user "
url="defineuser.jsf"/>
</p:submenu>
<p:submenu label="#{etiketler.yapilandirmaIslemleri}" icon="dt dt03" >
<p:menuitem value="#{etiketler.sablonIslemleri}"
url="sablonTanimlama.jsf"/>
<p:menuitem value="#{etiketler.sistemYapilandirma}"
url="sistemYapilandirma.jsf"
/>
</p:submenu>
<p:menuitem value="help"
icon="dt dt19" url="yardim.jsf"/>
<p:menuitem value="exit" icon="dt dt17"
url="logout.jsf" />
</p:menubar>
</h:form>
<p:growl id="messages"/>
<ui:insert name="ajaxStaus">
</ui:insert>
</h:body>
</f:view>
</ui:composition>
实际上,上面提到的代码属于“menubar.xhtml”我想添加“layout.xhtml”页面,包括“menubar.xhtml”。
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
>
<script type="text/javascript" language="javascript">
function goLogoutPage(pageName) {
window.location = pageName;
}
function goPage(loc) {
window.location = loc;
}
</script>
<h:head>
<title>
<ui:insert name="title">NAME OF THE PROJECT</ui:insert>
</title>
<link rel="stylesheet" type="text/css" href="resources/css/tsmp.css"/>
</h:head>
<h:body>
<f:view contentType="text/html" locale="#{localeBean.locale}" >
<p:ajaxStatus onstart="waitDialog.show()" oncomplete="waitDialog.hide()"/>
<p:dialog modal="true" resizable="false" widgetVar="waitDialog" header="PROCESSING...PLEASE WAIT " draggable="false" closable="false">
<h:graphicImage value="resources/images/loading.gif"/>
</p:dialog>
<p:layout fullPage="true" >
<p:layoutUnit position="north" size="112" collapsible="false" >
<div id="page-header" >
<div class="container content">
<h1>
<a>PROJECT A</a>
</h1>
<div class="login" >
<h:graphicImage value="resources/images/k.png"/>
<h:outputLabel value="NAME"/>
</div>
</div>
</div>
<ui:include src="/menubar.xhtml" />
</p:layoutUnit>
<p:layoutUnit position="south" >
<ui:include src="/footer.xhtml" />
</p:layoutUnit>
<p:layoutUnit position="center" >
<p:growl id="msgs" life="8000" autoUpdate="true"/>
<ui:insert name="pageContent">
</ui:insert>
</p:layoutUnit>
</p:layout>
</f:view>
</h:body>
</html>
我需要改变“menubar.xhtml”或“layout.xhtml”?
【问题讨论】:
标签: javascript ajax jsf primefaces xhtml