Multiple portlets on Liferay page not working

UI Components for JSF
tomtom
Posts: 10
Joined: 22 Aug 2011, 09:35

24 Oct 2011, 12:01

I just did a rebuild of the trunk and a lot af css and js files are gone now, but I see primefaces.js and primefaces.css , should I include these to let my portlets work?

Tom

erdemeng
Posts: 3
Joined: 02 Jan 2012, 17:54

02 Jan 2012, 18:25

Thanks to everybody,
I solved this problem by following these steps.

1) created a directory in webapps, "primefaces". Copied all files under primefaces.jar/META-INF/resources/primefaces to that directory.
2) added these lines to your template.xhtml

Code: Select all

<h:head>
<script type="text/javascript" src="#{request.contextPath}/primefaces/primefaces.js"></script>
<script type="text/javascript" src="#{request.contextPath}/primefaces/jquery/jquery.js"></script>
<script type="text/javascript" src="#{request.contextPath}/primefaces/editor/editor.js"></script>
<script type="text/javascript" src="#{request.contextPath}/primefaces/charts/charts.js"></script>
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/primefaces/primefaces.css"></link>
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/primefaces/editor/editor.css"></link>
<link type="text/css" rel="stylesheet" href="#{request.contextPath}/primefaces/charts/charts.css"></link>
<!-- add other js and cs references as above -->
</h:head>
3) included template.xhtml from other xhtml files :)

I tested it for PrimeFaces(3.0)+PortletFacesBridge(2.0.1)+Liferay(6.0.6)

Note: To display images that are referenced from css files, you must alter image references in css files

Image

baspet
Posts: 37
Joined: 18 Jan 2011, 14:53

03 Jan 2012, 01:01

Hi,

you will exprience problems if your page contains 2 or more portlets based on this template.
<header-portlet-css>, <header-portlet-javascript> are your friends:)

V.

erdemeng
Posts: 3
Joined: 02 Jan 2012, 17:54

03 Jan 2012, 09:39

Hi,
including <header-portlet-css>, <header-portlet-javascript> in liferay-portlet.xml did not work for me :(

what kind of problems occur?
Our portal page contains seven or more portlets based on this template, but I did'nt see any problems.

baspet
Posts: 37
Joined: 18 Jan 2011, 14:53

03 Jan 2012, 13:41

hi,

browser will load 7 times jquery.js, 7 times primefaces.js, etc. If no problem with this, everything fine!

V.

tomtom
Posts: 10
Joined: 22 Aug 2011, 09:35

02 Feb 2012, 15:01

Any progress on this ?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Feb 2012, 15:02

Not a PF specific issue, it is a mismatch of JSF and portlets, portletfaces bridge forum is better place to ask.

ngriffin7a
Posts: 6
Joined: 13 Feb 2012, 19:48

10 May 2012, 23:28

Please refer to FACES-1216 for more information.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 39 guests