0

I'm using IntroJs framework (https://introjs.com/) and my problem is to do a tour (intro) on a tabView (primefaces component). When I put the inline atribute data-intro in a p:tab component, the primefaces ignores them and the html component it generates cannot be seen by the introJs start() function.

Here is my code:

<p:tabView id="tabView" scrollable="true" styleClass="users">
    <p:tab title="ldap" id="tabLDAP" data-intro="test">
    <ui:include src="tabldap.xhtml" />
</p:tab>
Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40

1 Answers1

1

To render attributes that are not JavaServer Faces attributes you need to use Pass-Through Attributes. I see that you are using Primefaces, so this is one useful blog post:

JSF 2.2 has a great feature to add dynamic attributes to a component on runtime, these attributes are called pass through attributes. PrimeFaces 4.0 is aimed to support JSF 2.0, 2.1 and 2.2 at the same time using runtime detection and lately pass through attributes support is added to 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

Another useful article: Java Platform, Enterprise Edition: The Java EE Tutorial, Section 8.9.2 Using Pass-Through Attributes

anotherUser
  • 551
  • 6
  • 29