0

I am trying to include ".xhtml" in other; and it works perfectly in "Internet Explorer" but not in "Chrome"

My principale view which include two views one of them is menu.xhtml :

<ui:define name="content">
    <div class="ui-grid ui-grid-responsive">
        <div class="ui-grid-row">

            <div class="ui-grid-col-1" id="menuLeft">
                 <ui:include src="menu.xhtml" /> 

            </div>

            <div class="ui-grid-col-1" id="ber">
                <p:panel id="principalePanel" >
                    <ui:include src="#{navigationBean.page}" />
                </p:panel>
            </div>

        </div>
    </div>

</ui:define>

menu.xhtml:; i am supposed to include other view in my My principale view using <b:navLink>

<b:panel id="basic" title="Modules" collapsible="false" look="primary">
        <h:form id="formMenuLeft">

            <p:accordionPanel id="panelMenuLeft">

                <p:tab title="R H" id="tabMenuLeft">

                    <b:flyOutMenu  id="ferd">

                        <b:navLink value="New Compte" id="navcreat"
                         update="@([id$=principalePanel])" onclick="ajax:navigationBean.setPage('viewcreat.xhtml')"/>

                        <b:navLink value="search" id="fedrt" update=":#{p:component('principalePanel')}"onclick="ajax:navigationBean.setPage('viewSearch.xhtml')"/>

                    </b:flyOutMenu>

                </p:tab>

            </p:accordionPanel>

            </h:form>
            </b:panel>
techipank
  • 432
  • 4
  • 17
user3693890
  • 203
  • 1
  • 6
  • 15
  • Can you check is there any nested form in your page while you were including page dynamically here nested means form inside form which is not allowed. – techipank May 03 '16 at 04:51
  • Does it work using a plain `h:panelGroup` instead of a `p:panel`? Does it work if you put the `b:*` code outside a the `p:accordionPanel`? does it work if you don't use an include but put the code directly in tha page... [mcve] – Kukeltje May 03 '16 at 06:44
  • Kukeltje; even if i use 'h:panelGroup' instead of a 'p:panel' the same problem still exist, the view cannot include other. – user3693890 May 03 '16 at 13:47

1 Answers1

0

Actually, the example does work on Chrome, at least on OSX. I'll post my version - maybe there's a subtle difference lurking in the dark:

index.xhtml:

    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <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:b="http://bootsfaces.net/ui"
          xmlns:p="http://primefaces.org/ui"
          xmlns:ui="http://java.sun.com/jsf/facelets">
        <h:head>
            <title>BootsFaces: next-gen JSF Framework</title>
            <meta name="author" content="Riccardo Massera"></meta>
        </h:head>
        <h:body style="padding-top: 60px">
          <div class="ui-grid ui-grid-responsive">
              <div class="ui-grid-row">
                  <div class="ui-grid-col-5" id="menuLeft">
                       <ui:include src="menu.xhtml" />
                  </div>
                  <div class="ui-grid-col-5" id="ber">
                      <p:panel id="principalePanel" title="principale" >
                         <ui:include src="#{navigationBean.page}" />
                      </p:panel>
                  </div>
              </div>
          </div>
        </h:body>
    </html>

menu.xhtml:

    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <ui:fragment xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:p="http://primefaces.org/ui "
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:b="http://bootsfaces.net/ui"
          xmlns:ui="http://java.sun.com/jsf/facelets">
      <b:panel id="basic" title="Modules" collapsible="false" look="primary">
        <h:form id="formMenuLeft">

          <p:accordionPanel id="panelMenuLeft">
            <p:tab title="R H" id="tabMenuLeft">
              <b:flyOutMenu id="ferd">
                <b:navLink value="New Compte" id="navcreat" update="@([id=principalePanel])"
                  onclick="ajax:navigationBean.setPage('start.xhtml')" />
                <b:navLink value="search" id="fedrt" update=":#{p:component('principalePanel')}"
                  onclick="ajax:navigationBean.setPage('search.xhtml')" />
              </b:flyOutMenu>
            </p:tab>
          </p:accordionPanel>
        </h:form>
      </b:panel>
    </ui:fragment>

search.xhtml:

    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <ui:fragment xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:p="http://primefaces.org/ui "
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:b="http://bootsfaces.net/ui"
          xmlns:ui="http://java.sun.com/jsf/facelets">
     <b:panel title="Search" look="success">
     </b:panel>
    </ui:fragment>

start.xhtml:

    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <ui:fragment xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:p="http://primefaces.org/ui "
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:b="http://bootsfaces.net/ui"
          xmlns:ui="http://java.sun.com/jsf/facelets">
      <b:panel title="Create" look="primary">
      </b:panel>
    </ui:fragment>

NavigationBean.java:

    package net.bootsfaces.demo.ajax;

    import java.io.IOException;
    import java.io.Serializable;

    import javax.faces.bean.ManagedBean;
    import javax.faces.bean.SessionScoped;
    import javax.faces.context.FacesContext;

    @ManagedBean
    @SessionScoped
    public class NavigationBean implements Serializable {
        private static final long serialVersionUID = 1L;

        private String page="start.xhtml";

        public String getPage() {
            return page;
        }

        public void setPage(String currentPage) {
            this.page=currentPage;
        }
     }        
Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37