我有一个页面'report1.xhtml'和'report2.xhtml',其中两个使用相同的模板'template.xhtml'。
这是'template.xhtml':
<pe:layout fullPage="true" id="collapsibleLayoutPanel" stateCookie="false" widgetVar="templateLayoutWidget" style="100%;">
<pe:layoutPane id="topPanel" styleClassContent="topPanel unhideMenus" position="north" resizable="false"
closable="false" spacingClosed="0" spacingOpen="0">
<p:outputPanel id="dg">
<p:outputPanel id="dMHeader" styleClass="A_class Amarks_top">
#{tController.classificationMarking}
</p:outputPanel>
</p:outputPanel>
<div id="Ar" class="Aer" role="banner">
<div id="my_apps" style="display:none;">
<h:outputLink rendered="#{primaryMenuController.renderReturnToMyApps}"
value="#{primaryMenuController.myAppsUrl}">
<img id="my_apps_img" src="#{request.contextPath}/resources/img/my_apps.png" alt="My Apps"
title="My Apps"/>
</h:outputLink>
</div>
<b:navBar brandImg="#{request.contextPath}/resources/img/X_logo.png"
brandHref="#{request.contextPath}/view/landingPage.jsf">
<b:navbarLinks>
<div class="ui-grid-col-6">
<ui:include src="prnu.xhtml"/>
</div>
<div class="ui-grid-col-6">
<div id="A_logout">
<h:form id="helpLogoutForm">
<p:menubar styleClass="Aout_menu" autoDisplay="false">
<p:submenu
label="#{pController.name} (#{pController.accountType})"
icon="primnav-user-acct">
<p:menuitem id="myDashboardLink" value="My Dashboard"
action="landingPage" a:allowRead="true"
icon="primnav-dashboard"/>
<p:menuitem id="myMessagesLink" value="My Messages"
action="userMessageList" a:allowRead="true"
icon="primnav-inbox"/>
<p:menuitem id="myPrefLink" value="My Preferences"
oncomplete="PF('upDialog_widget').show();"
a:allowRead="true" icon="primnav-preferences"/>
<p:separator/>
<p:menuitem id="logoutLink" value="Logout"
action="#{primaryMenuController.logout}"
a:allowRead="true" onclick="X.logoutHandler();"
icon="primnav-logout" ajax="false"/>
</p:submenu>
<p:submenu icon="primnav-help">
<p:menuitem value="Help"
onclick="window.open('#{request.contextPath}/help/default.htm', 'Help', 'height=600,width=850,resizable=yes'); return false;"
icon="primnav-help_menu_child" a:allowReadHelp="true"/>
<p:menuitem value="About"
action="#{aController.updateMemoryValues()}"
oncomplete="PF('aboutDialog_widget').show();"
a:allowRead="true" icon="primnav-help_menu_child"
update=":aboutDialog"/>
</p:submenu>
</p:menubar>
</h:form>
</div>
</div>
</b:navbarLinks>
</b:navBar>
</div>
<ui:insert name="tertiaryNavMenu"/>
</pe:layoutPane>
<!-- Main content -->
<pe:layoutPane id="centerPanel" styleClassContent="centerPanel" position="center" spacingClosed="0"
spacingOpen="0">
<pe:layoutPane position="north" id="nestedTopPanel" size="45" resizable="false" closable="false"
styleClassContent="unhideMenus"
spacingClosed="0" spacingOpen="0" rendered="#{not hideTitleActionBar}">
<div id="A_content" class="AE_content" role="main">
<div class="ui-grid ui-grid-responsive">
<div class="ui-grid-row template-header">
<div class="ui-grid-col-3 template-title">
<div id="A_content_pagetitle" class="AE_content_pagetitle">
<h1 class="pagetitle_h1"><ui:insert name="contentHeader"></ui:insert></h1>
</div>
</div>
<div class="ui-grid-col-9 template-actions">
<div class="action_buttons">
<ui:insert name="actionMenu"></ui:insert>
</div>
</div>
</div>
</div>
</div>
</pe:layoutPane>
<pe:layoutPane position="center" id="nestedCenterPanel" spacingClosed="0" spacingOpen="0">
<div id="A_content_body" class="A_content_body" style="padding:0 12px;">
<p:growl id="siteMessages" globalOnly="true" showDetail="true" life="4000" autoUpdate="false"
widgetVar="siteMessages_widget"
sticky="#{not empty facesContext.maximumSeverity and facesContext.maximumSeverity.ordinal gt 1}"/>
<ui:insert name="content"></ui:insert>
</div>
</pe:layoutPane>
</pe:layoutPane>
<!-- Bottom markings -->
<pe:layoutPane id="bottomPanel" styleClassContent="bottomPanel" position="south" resizable="false"
closable="false" spacingClosed="0" spacingOpen="0">
<!-- TODO: Determine classification marks to display -->
<!-- BEGIN FOOTER -->
<p:outputPanel styleClass="A_classmarking AE_body_classmarks_bottom" id="documentMarkingFooter">
#{tController.classificationMarking}
</p:outputPanel>
<!-- END FOOTER -->
</pe:layoutPane>
</pe:layout>
当我加载report1.xhtml并将窗口调整为iPhone大小(640x960)时,一切都按预期工作,汉堡菜单onclick显示以前隐藏的菜单选项。然而,在导致页面转发到report2.xhtml的onchange事件之后,汉堡菜单onclick不再有效..它仍然是可点击的但是点击后没有任何反应..如果我使导航重定向而不是向前翻页,一切正常,所以我的结论是这与页面转发有关...
在devtools控制台上调试后,我在页面加载后出现此错误(仅限页面转发):
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
来源js是http://localhost:8080/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=5.2.7
然后在调整大小时,我从源https://raw.githubusercontent.com/primefaces-extensions/core/master/src/sourcemap/3.2.0/layout.source.js收到此错误:
Uncaught TypeError: Cannot read property 'state' of undefined
再次注意,这些错误仅在导航向前翻页时发生,在进行重定向时消失。我不想进行重定向,因为我希望URL保持不变..