【问题标题】:Primefaces , jquery issue on including page with ui:include in p:tabviewPrimefaces , jquery 问题包括页面与 ui:include 在 p:tabview
【发布时间】:2012-04-26 09:21:43
【问题描述】:

我构建了一个 JSF 2.1.2 页面,其中包含各种 primefaces 组件,例如 p: calendar、p: selectOneMenu ... 此页面工作正常。 但 : 我需要将第一页集成到 p:tab 元素中的另一个页面中,其中 p:TabView parent : 像这样:

<p:tabView id="tabview">
 <p:tab title="User admin">
  <ui:include src="firstPage.xhtml" />
 </p:tab>
</p:TabView>

问题:primefaces 组件不再工作(例如 p:calendar 不显示),我遇到了很多错误,比如 jQuery 不存在:

$(this.jqId + " ul").sortable is not a function
[Stopper sur une erreur]    

...d+" .ui-picklist-target-controls .ui-picklist-button-move-up").click(function(){...

primef...mefaces (ligne 27)
$(this.jqId + " ul").sortable is not a function
[Stopper sur une erreur]    

...d+" .ui-picklist-target-controls .ui-picklist-button-move-up").click(function(){...

.....

感谢您的帮助。 克里斯托夫。

【问题讨论】:

  • 说,如果你把它改成 src="/firstPage.xhtml" (加了"/") ...?也...我猜 是一个错字?大写“T”

标签: jsf-2 primefaces


【解决方案1】:

确保您的 HTML 输出在语法上是有效的。如果firstPage.xhtml 代表一个完整的&lt;html&gt; 页面,那么当您将其用作另一个&lt;html&gt; 页面中的包含文件时,这将失败,因为嵌套&lt;html&gt;&lt;head&gt;&lt;body&gt; 标记是非法的。

您需要从firstPage.xhtml 中删除所有&lt;html&gt;&lt;head&gt;&lt;body&gt; 标签,这样它才能真正代表唯一的标签内容。例如

<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"
>
    <p>This is the tab content.</p>
</ui:composition>

【讨论】:

猜你喜欢
  • 2010-11-20
  • 2015-07-17
  • 1970-01-01
  • 2014-12-02
  • 2015-10-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多