0

I have a page 'report1.xhtml'and 'report2.xhtml'both of which is using the same template 'template.xhtml'.

Here's '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>

When I load report1.xhtml and resize window to iPhone size(640x960) everything works as expected and the burger menu onclick is showing the previously hidden menu options. However after the onchange event that causes page forward to report2.xhtml, the burger menu onclick is no longer working.. It's still clickable but nothing happens after clicking it.. If I make the navigation redirect instead of page forward, everything works just fine, so my conclusion is this has something to do with page forward...

After debugging on the devtools console I've got this error showing up after page load(for page forward only):

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/.

The source js is http://localhost:8080/javax.faces.resource/jquery/jquery.js.jsf?ln=primefaces&v=5.2.7

Then on resize I've got this error from source https://raw.githubusercontent.com/primefaces-extensions/core/master/src/sourcemap/3.2.0/layout.source.js:

Uncaught TypeError: Cannot read property 'state' of undefined 

Again, note that those errors only occur when navigation is page forward and goes away when doing a redirect. I don't want to do a redirect because I want the URL to stay the same..

kdm06
  • 189
  • 9
  • You're error description is great, but I still feel there's some important information missing. For once, what is the burger menu? Maybe it would help to show us the two JSF pages and the bean, too. What is the difference between the navigation redirect and the page forward? More precisely, which method calls do you refer to? Maybe you should also try to reduce the complexity of your example. It contains a lot of code. Most likely, most of the code hasn't got anything to do with your problem. – Stephan Rauh Dec 10 '15 at 18:24
  • @StephanRauh , A burger menu is a UI button-like component that bootsfaces produces for small screen sizes. If initially your screen is desktop size you would see all the navigation menu displayed on the navbar but if you resize to a smaller one, the menu would be hidded and replaced with a burger menu to nicely fit into a small screen and the menu items will only be shown if you click on that burger menu... – kdm06 Dec 11 '15 at 01:21
  • The method is really just an action on the commandbutton that returns the logical view string say 'report2', therefore forwarding to report2.xhtml.. Since I didn't place on the navigation case it will default to a page forward i.e. single request-response cycle and URL will not change – kdm06 Dec 11 '15 at 01:32
  • As to the complexity of the code example, I can't edit it but what I'm showing is the layout that's using primefaces extension and bootsfaces navBar and navBarLinks.. Note that the error on devtools console is showing that 'layoutPane' is undefined thus the error: Uncaught TypeError: Cannot read property 'state' of undefined – kdm06 Dec 11 '15 at 01:34
  • My gut feeling is that this error has nothing to do with BootsFaces. It's much more likely the problem is in the PrimeFaces Extensions realm. So I've shown the bug to one of the developers of PrimeFaces Extensions. He suggests you open a bug on their bug tracker (https://github.com/primefaces-extensions/primefaces-extensions.github.com/issues). – Stephan Rauh Dec 11 '15 at 23:08

0 Answers0