1 Reply Latest reply on Aug 3, 2011 4:48 PM by Karsten Wutzke

    Facelets ui:insert not inserting title into rich:page header

    Karsten Wutzke Expert

      I'm using the following template:

       

      {code}<?xml version="1.0" encoding="UTF-8"?>

      <rich:page xmlns="http://www.w3.org/1999/xhtml"

                 xmlns:h="http://java.sun.com/jsf/html"

                 xmlns:f="http://java.sun.com/jsf/core"

                 xmlns:s="http://jboss.com/products/seam/taglib"

                 xmlns:ui="http://java.sun.com/jsf/facelets"

                 xmlns:a4j="http://richfaces.org/a4j"

                 xmlns:rich="http://richfaces.org/rich"

                 markupType="xhtml"

                 contentType="text/html"

                 theme="simple">

       

        <a4j:loadStyle src="resource:///styles/custom.xcss" />

       

        <f:facet name="pageHeader">

          <title><ui:insert name="title" /></title>

          <link rel="stylesheet" type="text/css" href="styles/richfaces.css" />

          <script type="text/javascript">

              function setCaretToEnd (e) {

                 ...

              }

          </script>

        </f:facet>

       

        <f:facet name="header">

          <ui:include src="views/rich-header.xhtml" />

        </f:facet>

        <rich:layout>

        ...

        </rich:layout>

        <f:facet name="footer">

          <ui:include src="views/footer.xhtml" />

        </f:facet>

      </rich:page>{code}

       

      Note the line

       

      {code}    <title><ui:insert name="title" /></title>{code}

       

      in the page header. In my concrete view I use

       

      {code}<?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">

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

                      xmlns:f="http://java.sun.com/jsf/core"

                      xmlns:h="http://java.sun.com/jsf/html"

                      xmlns:s="http://jboss.com/products/seam/taglib"

                      xmlns:ui="http://java.sun.com/jsf/facelets"

                      xmlns:a4j="http://richfaces.org/a4j"

                      xmlns:rich="http://richfaces.org/rich"

                      template="/templates/richfaces.xhtml">

        <ui:define name="title">

          <h:outputText value="Season Selector" />

        </ui:define>

        <ui:define name="content">

          ...

        </ui:define>

      </ui:composition>{code}

       

      What gets rendered all the time is a closing </title> tag (not start tag, no title text):

       

      {code}<head>

        <script src="/bbstats/a4j/g/3_3_3.Final/org/ajax4jsf/framework.pack.js.seam" type="text/javascript"></script>

        <script src="/bbstats/a4j/g/3_3_3.Final/org/richfaces/ui.pack.js.seam" type="text/javascript"></script>

        <link class="component" href="/bbstats/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAGbUnaFO3T5DGkAEaUDmQ__.seam" rel="stylesheet" type="text/css" />

      <link class="component" href="/bbstats/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAGbUnaFO3T5DGkAEaUDmQ__.seam" media="rich-extended-skinning" rel="stylesheet" type="text/css" />

      <link class="component" href="/bbstats/a4j/s/3_3_3.Final/org/richfaces/skin.xcss/DATB/eAGbUnaFO3T5DGkAEaUDmQ__.seam" rel="stylesheet" type="text/css" />

      <script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script>

      <link class="user" href="/bbstats/a4j/s/3_3_3.Final/styles/custom.xcss/DATB/eAGbUnaFO3T5DGkAEaUDmQ__.seam" rel="stylesheet" type="text/css" />

      <link type="text/css" rel="stylesheet" class="component" href="/bbstats/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/simple.xcss/DATB/eAGbUnaFO3T5DGkAEaUDmQ__.seam" />

      <style type="text/css">.rich-page{margin:auto 10px;width:auto;}

      .rich-page-body{float:none;width:auto;}

      </style>

      </title>

          <link rel="stylesheet" type="text/css" href="styles/richfaces.css" />

          <script type="text/javascript">

              function setCaretToEnd (e) {

          ...

              }

          </script>

      </head>{code}

       

      There has been a very similar issue for a previous RF version:

       

      https://issues.jboss.org/browse/RF-7249

       

      However that code uses f:view and (strangely) an h:panelGroup in the page header. Don't know if that matters.

       

      Anyway, what's wrong? Is it my code? Is it a bug? I'm using RF 3.3.3.

       

      Karsten