0

I have a problem.

I'm making a website with the layout of PrimeFaces, which loads a page in the center when I click on any menu item on the left, but when I use the theme of BootsFaces (<bnu: panel ....> </bnu: panel>, page load in the center but it is not another load, when I do not use the theme, everything works fine but the panel shown in plain text without style look = "success" for example.

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:bnu="http://bootsfaces.net/ui">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>My Page</title>
    </h:head>
    <h:body>
        <p:layout fullPage="true">

            <p:layoutUnit position="north" size="100" resizable="false" closable="false" collapsible="false" >
                <h1>PAGE</h1>

            </p:layoutUnit>


            <p:layoutUnit position="west" size="195" header="Panel" resizable="true" closable="false" collapsible="true" >
                <h:form id="form" >

                    <p:menu>
                        <p:menuitem id="abc" value="Inicio" action="#{bean.page0()}" update=":content:pcenter" />
                        <p:submenu label="ABC" >
                            <p:menuitem id="X1" value="CC1" action="#{bean.page1()}" update=":content:pcenter"/>
                            <p:menuitem id="X2" value="CC2" action="#{bean.page2()}" update=":content:pcenter"/>
                            <p:menuitem id="X3" value="CC3" action="#{bean.page3()}" update=":content:pcenter"/>
                        </p:submenu>
                    </p:menu>

                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="center" header="Welcome user" >
                <h:form id="content">
                    <p:panel id="pcenter">
                        <ui:include src="#{bean.page}.xhtml" />
                    </p:panel>
                 </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="south" size="100" header="Bottom" resizable="false" closable="false" collapsible="false">
                <h:outputText value="South unit content." />
            </p:layoutUnit>

        </p:layout>         
    </h:body>
</html>

I try this and not show the style look="success" but show the title

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:bnu="http://bootsfaces.net/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <bnu:panel id="pdata" title="User data" collapsible="true" look="success">
           <p:outputLabel value="Name" for="txt_name"/>
                <p:inputText id="txt_name" label="Name" required="true">
                </p:inputText>
    </bnu:panel>
</html>

I try this, and the same

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
    xmlns:ui="http://java.sun.com/jsf/facelets">

    <bnu:panel id="pdata" title="User data" collapsible="true" look="success">
           <p:outputLabel value="Name" for="txt_name"/>
                <p:inputText id="txt_name" label="Name" required="true">
                </p:inputText>
    </bnu:panel>
</ui:composition>

And try this, working but after not load the pages in the center when click elements of left menu

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:bnu="http://bootsfaces.net/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

   <head>
   </head>
    <bnu:panel id="pdata" title="User data" collapsible="true" look="success">
           <p:outputLabel value="Name" for="txt_name"/>
                <p:inputText id="txt_name" label="Name" required="true">
                </p:inputText>
    </bnu:panel>
</html>
Tiny
  • 27,221
  • 105
  • 339
  • 599
MiguelxTx
  • 1
  • 1
  • 1
  • *"page load in the center but it is not another load"* huh? What are you trying to tell there? – BalusC Sep 16 '15 at 09:24
  • I guess it should read "the default page fragment is shown in the center, but when I click one of the menu items, the central panel isn't updated with the new page fragment". – Stephan Rauh Sep 16 '15 at 11:53
  • BTW, I had some trouble to reverse-engeneer the bean. Would you mind to add it next time? Plus the web.xml, the faces-config.xml and the pom.xml? This makes it a lot easier to reproduce your problem. As I wrote in my answer, I suspect the error hides in one of the latter three files. – Stephan Rauh Sep 16 '15 at 11:56
  • 1
    The question title is awkward, it could fit any other question about JSF, PrimeFaces and BootsFaces, so I wanted to update it to just say the concrete problem, as every other good question title, but I'm still not understanding the concrete problem so far. – BalusC Sep 16 '15 at 12:21

1 Answers1

3

Actually, each of the three versions work. I've created a project based on your XHTML pages, and it runs flawlessly. Both with and without the PrimeFaces Bootstrap theme. So my best guess is there's a problem with your project setup.

I recommend you check out my example from https://github.com/stephanrauh/BootsFaces-Examples/tree/master/PrimeFacesLayout and try to find the difference to your project.

enter image description here

Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37