【问题标题】:Tour with IntroJs framework in primefaces tabView doesn't work在 primefaces tabView 中使用 IntroJs 框架游览不起作用
【发布时间】:2018-01-03 13:26:36
【问题描述】:

我正在使用 IntroJs 框架 (https://introjs.com/),我的问题是在 tabView(primefaces 组件)上进行游览(介绍)。 当我将内联属性 data-intro 放在 p:tab 组件中时,primefaces 会忽略它们,并且 introJs start() 无法看到它生成的 html 组件em> 函数。

这是我的代码:

<p:tabView id="tabView" scrollable="true" styleClass="users">
    <p:tab title="ldap" id="tabLDAP" data-intro="test">
    <ui:include src="tabldap.xhtml" />
</p:tab>

【问题讨论】:

  • 如果您是我们,请阅读您的问题...您认为您可以帮忙吗?我个人是做不到的。请阅读How to Askminimal reproducible example...
  • 抱歉,第一次来这里。更好?
  • 嗯,只是好一点。至少有一些示例代码,但它不是最小的,也不是完整的,也不是可验证的

标签: jsf primefaces intro.js


【解决方案1】:

要呈现不是 JavaServer Faces 属性的属性,您需要使用 Pass-Through Attributes。 我看到您正在使用 Primefaces,所以这是一篇有用的博文:

JSF 2.2 有一个很棒的特性可以为组件添加动态属性 在运行时,这些属性称为传递属性。 PrimeFaces 4.0 旨在同时支持 JSF 2.0、2.1 和 2.2 使用运行时检测和最近传递属性的时间 4.0新增支持;

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>

<h:body>

<p:inputText value="#{bean.value}" pt:placeholder="Watermark here"/>

</h:body>
</html>

Source: Primefaces Blog

另一篇有用的文章:Java Platform, Enterprise Edition: The Java EE Tutorial, Section 8.9.2 Using Pass-Through Attributes

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-17
    • 2013-07-02
    • 1970-01-01
    • 2014-05-05
    • 2016-11-01
    • 1970-01-01
    相关资源
    最近更新 更多