JSF2 PrimeFaces3 Facelets更新内容失败

时间:2013-03-07 19:34:24

标签: ajax templates jsf-2 primefaces facelets

我的template.xhtml

<!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:f="http://java.sun.com/jsf/core"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:p="http://primefaces.org/ui">
<h:head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>X</title>
  <script type="text/javascript" src="js/primefaces-locale.js" />
</h:head>
<h:body style="margin: 0; padding: 0;height:100%;" >
<h:panelGroup id="mid" style="height:100%;">
  <h:panelGroup id="menu" style="height:100%;width:15%;float:left;background-color:#EEEEEE;">
    <ui:include src="menu.xhtml" />
  </h:panelGroup>
  <h:panelGroup id="content" style="height:100%;width:80%;float:left;overflow: hidden;margin-top: 1%; margin-left: 1%;">
      <h:messages id="msgs" />
      <ui:insert name="body" />
  </h:panelGroup>
</h:panelGroup>
</h:body>    
</html>

我的index.xhtml

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="template.xhtml" 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
<ui:define name="body">
<h:form id="formbody" >  
  <p:schedule id="prazos" locale="br" style="width: 100%;font-size:11px;font-weight:bold;" />
  <h:outputText value="#{IndexBean.nome}" />
</h:form>  
</ui:define>
</ui:composition>

我的menu.xhtml

<!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:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">
<h:form id="formMenu">
  <p:panelMenu style="width:100%;font-size:11px;font-weight:bold;">
    <p:submenu label="Clientes">   
        <p:menuitem value="Cadastrar" id="btCadCliente" icon="ui-icon-disk" action="cadastroCliente.xhtml" update=":content" />  
        <p:menuitem value="Consultar"  id="btConCliente" icon="ui-icon-search" action="consultaCliente.xhtml?faces-redirect=true" update=":content"  />  
    </p:submenu>  
  </p:panelMenu>
</h:form>
</ui:composition>

我的问题是点击menu.xhtml中的操作按钮(例如)。关于“:content”的ajax部分更新工作完美,但在渲染页面布局后,在顶部布局上创建一个新的空白行,并带有以下文本:“xmlns =”http://www.w3.org/1999/xhtml“&gt; ”。此文本是来自template.xhtml的uri名称空间。

任何帮助?

0 个答案:

没有答案