0

i have some serious problems with my jsf webpage. I've written an template.xhtml this way :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<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">
<f:view contentType="text/html" id="fview">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Page template with PrimeFaces</title>
    <ui:debug/>
    <f:metadata>
        <ui:insert name="metadata"/>
    </f:metadata>

    <head>
        <p:ajaxStatus onstart="statusDialog.show();" onsuccess="statusDialog.hide();"/>

        <p:layout fullPage="true">
            <p:layoutUnit position="north" style="border: 0;">
                <h:form>
                    <p:panel id="basic" header="Usermanagment und Selfcare"
                             style="border: 0;">
                        <h:outputText value="Willkommen #{login.user}" style="float:left"/>
                        <h:commandLink action="#{login.logout}" value="Logout" style="float:right"/>
                        <p:themeSwitcher id="basictheme" style="width:165px;display: table;margin: auto">
                            <f:selectItem itemLabel="Choose Theme" itemValue=""/>
                            <f:selectItems value="#{themeSwitcherView.themes}"/>
                        </p:themeSwitcher>
                    </p:panel>
                </h:form>
            </p:layoutUnit>
            <p:layoutUnit position="west" style="border: 0;">
            </p:layoutUnit>
            <p:layoutUnit position="center" style="border: 0;">
                <p:messages autoUpdate="true" id="msgs" showDetail="true" showSummary="true"/>
                <ui:insert name="content"/>
            </p:layoutUnit>
        </p:layout>

        <p:dialog modal="true" widgetVar="statusDialog" showHeader="false" draggable="false" closable="false" resizable="false" visible="false" position="center" maximizable="false" minimizable="false" >
            <p:graphicImage value="#{resource['images/ajax-loader.gif']}" />
        </p:dialog>
    </head>
    <body onload="statusDialog.hide();">
    </body>
</f:view>
</html>

and an index.xhtml like this

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="WEB-INF/template/layout.xhtml">
    <ui:define name="metadata">
    </ui:define>
    <ui:define name="content">
        Hello world! Welcome to a page derived from a template
    </ui:define>
</ui:composition>

So i want to have an Page with a sidebar with items to select new pages which are rendered in the center. But it seems like i have lost all primefaces design. The page looks like this:

enter image description here

So where is the designe gone? what am i missing?

Jordi Castilla
  • 26,609
  • 8
  • 70
  • 109
ScreamingTree
  • 302
  • 1
  • 13
  • Open the page in developer tools you will get to know whether your primefaces loaded or no .. – Rookie007 Sep 14 '15 at 08:25
  • hm okay, i see there are some errors. Seems like there is no reference for `$(function(){PrimeFaces.cw` but i still don't know why... – ScreamingTree Sep 14 '15 at 08:35
  • Are you sure of your primefaces xmlns ? you may wnt to use this `http://primefaces.prime.com.tr/ui` – Rookie007 Sep 14 '15 at 08:38
  • If i use `http://primefaces.prime.com.tr/ui` not a single primefaces function is called and nothing is rendered, but no errors. Regarding this [link](http://www.primefaces.org/gettingStarted) the namespace has to be `xmlns:p="http://primefaces.org/ui" ` – ScreamingTree Sep 14 '15 at 08:47
  • Oh thats it, thank you balusC! – ScreamingTree Sep 14 '15 at 08:52

0 Answers0