Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tatiana Kulish
Multiple PrimeFaces portlets
July 8, 2013 2:19 AM
Answer

Tatiana Kulish

Rank: New Member

Posts: 6

Join Date: July 8, 2013

Recent Posts

Hi, I'm using primefaces 3.5 portlets. I have 2 very basic potrlets lineCart http://www.primefaces.org/showcase/ui/lineChart.jsf and TabView http://www.primefaces.org/showcase/ui/tabviewDynamic.jsf, each of them works fine separately. But as soon as i put both of them on the page, lineChart stops showing anything and in the console i see error "Uncaught TypeError: Cannot call method 'replace' of undefined ".
When i remove portlet TabView, LineChart works fine again.
I noticed same behavior with elements <p:clock/> and <p:tabView ...>.
If i put this 2 elements in one portlet, they works fine, but i need to have them in separate portlets and i really don't know how to fix this problem.

Thank you
Juan Gonzalez
RE: Multiple PrimeFaces portlets
July 8, 2013 2:23 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1984

Join Date: October 28, 2008

Recent Posts

Can you post here your xhtml code snippets?

Perhaps you can try to generate an Id for each primefaces component with <portlet:namespace> prefixed in it.
Tatiana Kulish
RE: Multiple PrimeFaces portlets
July 8, 2013 2:43 AM
Answer

Tatiana Kulish

Rank: New Member

Posts: 6

Join Date: July 8, 2013

Recent Posts

here it is:

LineChart
 1 <?xml version="1.0"?>
 2
 3<f:view
 4    xmlns="http://www.w3.org/1999/xhtml"
 5    xmlns:c="http://java.sun.com/jsp/jstl/core"
 6    xmlns:f="http://java.sun.com/jsf/core"
 7    xmlns:h="http://java.sun.com/jsf/html"
 8    xmlns:p="http://primefaces.org/ui"
 9    xmlns:ui="http://java.sun.com/jsf/facelets"
10>
11    <h:head/>
12    <h:body>
13    <h:form id="form2">
14        <p:clock/>
15        <p:lineChart id="linear" value="#{chartTestBean.linearModel}" legendPosition="e" 
16     title="Linear Chart" minY="0" maxY="10" style="height:300px"/>   
17   
18     </h:form>
19    </h:body>
20</f:view>


TabView
 1<?xml version="1.0"?>
 2
 3<f:view
 4    xmlns="http://www.w3.org/1999/xhtml"
 5    xmlns:c="http://java.sun.com/jsp/jstl/core"
 6    xmlns:f="http://java.sun.com/jsf/core"
 7    xmlns:h="http://java.sun.com/jsf/html"
 8    xmlns:p="http://primefaces.org/ui"
 9    xmlns:ui="http://java.sun.com/jsf/facelets"
10>
11    <h:head />
12    <h:body>
13        <h:form id="form1"> 
14    <p:tabView id="tabView"> 
15 
16        <p:tab id="tba1" title="Godfather Part I"> 
17            <h:panelGrid columns="2" cellpadding="10"> 
18               
19                <h:outputText 
20                    value="The story begins as Don Vito Corleone, the head of a New York Mafia family, oversees his daughter's wedding. 
21                    His beloved son Michael has just come home from the war, but does not intend to become part of his father's business. T 
22                    hrough Michael's life the nature of the family business becomes clear. The business of the family is just like the head of the family, kind and benevolent to those who give respect, 
23                    but given to ruthless violence whenever anything stands against the good of the family." /> 
24            </h:panelGrid> 
25        </p:tab> 
26 
27        <p:tab id="tab2" title="Godfather Part II"> 
28            <h:panelGrid columns="2" cellpadding="10"> 
29                  
30                <h:outputText value="Francis Ford Coppola's legendary continuation and sequel to his landmark 1972 film, The_Godfather, parallels the young Vito Corleone's rise with his son Michael's spiritual fall, deepening The_Godfather's depiction of the dark side of the American dream. 
31                In the early 1900s, the child Vito flees his Sicilian village for America after the local Mafia kills his family. Vito struggles to make a living, legally or illegally, for his wife and growing brood in Little Italy, 
32                killing the local Black Hand Fanucci after he demands his customary cut of the tyro's business. With Fanucci gone, Vito's communal stature grows."/> 
33            </h:panelGrid> 
34        </p:tab> 
35 
36       
37 
38    </p:tabView> 
39</h:form> 
40    </h:body>
41</f:view>


I didn't really get how i supposed to use <portlet:namespace>?
Juan Gonzalez
RE: Multiple PrimeFaces portlets
July 8, 2013 2:47 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1984

Join Date: October 28, 2008

Recent Posts

Hi Tatiana,

sorry, I was wrong. Those id are automatically generated by Liferay Faces I guess.

What's your Liferay Faces version? Did you test this webapp in a non-portlet environment?
Tatiana Kulish
RE: Multiple PrimeFaces portlets
July 8, 2013 3:01 AM
Answer

Tatiana Kulish

Rank: New Member

Posts: 6

Join Date: July 8, 2013

Recent Posts

I use Liferay 6.1.1 jboss 7.1.1 and primefaces 3.5.
I didn't test it in non portlet environment.
My portlets is just examples from primefaces demo page, you can easily test them too. They works fine separately, but doesn't work together. Seems like problem comes from TabView, there is something what breaks other portlets, but i don't know if it is primefaces problem or liferay problem

Thank you
Juan Gonzalez
RE: Multiple PrimeFaces portlets
July 8, 2013 3:12 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1984

Join Date: October 28, 2008

Recent Posts

Liferay Faces version?
Tatiana Kulish
RE: Multiple PrimeFaces portlets
July 8, 2013 3:19 AM
Answer

Tatiana Kulish

Rank: New Member

Posts: 6

Join Date: July 8, 2013

Recent Posts

Sorry, i'm not sure if that what you are asking for

my faces-config.xml looks like this:
 1<faces-config
 2    version="2.0"
 3    xmlns="http://java.sun.com/xml/ns/javaee"
 4    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 5    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
 6>
 7    <lifecycle>
 8        <phase-listener>com.liferay.faces.util.lifecycle.DebugPhaseListener</phase-listener>
 9    </lifecycle>
10</faces-config>
Juan Gonzalez
RE: Multiple PrimeFaces portlets
July 8, 2013 3:20 AM
Answer

Juan Gonzalez

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1984

Join Date: October 28, 2008

Recent Posts

Please, upload your portlet so we can check.
Tatiana Kulish
RE: Multiple PrimeFaces portlets
July 8, 2013 3:27 AM
Answer

Tatiana Kulish

Rank: New Member

Posts: 6

Join Date: July 8, 2013

Recent Posts

RE: Multiple PrimeFaces portlets
Attachments: ChartTest-portlet.zip (4,651.3k), DashboardTest-portlet.zip (4,486.2k)
Neil Griffin
RE: Multiple PrimeFaces portlets
July 8, 2013 9:00 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Hi Tatiana,

Juan ask the right question regarding the Liferay Faces version. I took a look at the portlet you attached and I saw that your WEB-INF/lib folder had version 3.1.0-rc2 of Liferay Faces dependencies:

docroot/WEB-INF/liferay-faces-bridge-api-3.1.0-rc2.jar
docroot/WEB-INF/liferay-faces-bridge-impl-3.1.0-rc2.jar
docroot/WEB-INF/liferay-faces-portal-3.1.0-rc2.jar
docroot/WEB-INF/liferay-faces-util-3.1.0-rc2.jar

My best guess is that you created the portlets with Liferay IDE via the Liferay 6.1.1 Plugins SDK. The template projects inside that version of the Plugins SDK contain version 3.1.0-rc2 of those dependencies, so whenever you create a new portlet, you are starting with old stuff.

When you get a chance, please download the 3.1.2-ga3 version of the dependencies from the downloads page and replace the old versions.

Note that you will probably want to first DELETE the deployed portlets from tomcat/webapps so that you don't end up with both the old and new versions of the dependencies when you re-deploy the portlets.

Kind Regards,

Neil
Tatiana Kulish
RE: Multiple PrimeFaces portlets
July 9, 2013 1:32 AM
Answer

Tatiana Kulish

Rank: New Member

Posts: 6

Join Date: July 8, 2013

Recent Posts

Thank you very much.

You was right, it solved the problem
Neil Griffin
RE: Multiple PrimeFaces portlets
July 12, 2013 3:11 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Glad to hear that it is working now. Thanks for using Liferay Faces. emoticon