Combination View Flat View Tree View
Threads [ Previous | Next ]
David Proba
Primefaces GMap not rendering
June 21, 2012 3:47 AM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

Hey guys,

I have trouble with Primefaces GMap.
As long as I was using PF 3.2, there was no problem with GMap, since updating to PF 3.3.1 and Liferay Faces 3.1 GMap is not rendering any more.
Is this a PF issue or a Liferay Faces issue ?

I am using PF 3.3.1 with Liferay 6.1 CE and Liferay Faces 3.1.

Thanks for your suggestions...
Neil Griffin
RE: Primefaces GMap not rendering
June 21, 2012 7:47 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

When you get a chance, please try to reproduce the problem with FireFox+FireBug and let me know if you see any JavaScript errors in the FireBug console. Thanks.
David Proba
RE: Primefaces GMap not rendering
June 21, 2012 1:36 PM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

Hi Neil,

thx for your help. There are 2 things from Firebug:
  • $("script[src*=\"/javax.faces.resource/primefaces.js\"]").attr("src") is undefined - shown in console
  • GET http://maps.googleapis.com/maps/gen_204?ev=api_ads&cad=src:apiv3,ads:0 gets status 204 No Content - shown in network, graphics
Neil Griffin
RE: Primefaces GMap not rendering
June 22, 2012 6:45 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Do you have more than one PrimeFaces portlet on the portal page?
David Proba
RE: Primefaces GMap not rendering
June 25, 2012 6:19 AM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

Yes, I have a couple of PF portlets on this page... Is this a problem ?
Neil Griffin
RE: Primefaces GMap not rendering
June 25, 2012 7:29 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Yes, due to PrimeFaces Issue#4093 there can be JavaScript conflicts with more than one PrimeFaces portlet on a single portal page.

When you get a chance, please try it with one PrimeFaces portlet and see if your JavaScript errors go away. Thanks.
David Proba
RE: Primefaces GMap not rendering
July 17, 2012 4:53 AM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

Hi Neil,

do you know when this issue with multiple PF portlets will be done ?
Unfortunatly, it's a partial showstopper....

Best regards
Neil Griffin
RE: Primefaces GMap not rendering
September 4, 2012 12:30 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

I just committed a Liferay vendor-specific fix for FACES-1216. Please give it a try as soon as you can. You can download 3.1.0-ga1-SNAPSHOT artifacts from the snapshot repository.
David Proba
RE: Primefaces GMap not rendering
August 22, 2012 8:29 AM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

Hi Neil,

thx for your help so far.
Actually, the problem with gmap still appears.

Currently, I use Liferay 6.1 GA1, Liferay Faces Bridge 3.1.0 GA1 and PF 3.3 with multiple portlets on a page.
Without Gmap portlet there is no js error displayed in console.
All other portlets (i.e. DataTable within Dialog) are working properly, but as soon as I deploy additionaly this one portlet including Gmap, I get "$("script[src*=\"/javax.faces.resource/primefaces.js\"]").attr("src") is undefined" error in console...
Neil Griffin
RE: Primefaces GMap not rendering
August 22, 2012 8:55 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Does it work OK if the gmap portlet is the only portlet on the portal page?
David Proba
RE: Primefaces GMap not rendering
August 23, 2012 7:14 AM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

If GMap portlet is the only one, it works fine...
Neil Griffin
RE: Primefaces GMap not rendering
August 27, 2012 12:52 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Using the primefaces3-portlet demo, I added one p:gmap component tag (the same markup found in the GMap - Basic demo) to the view and I got the following JavaScript errors:

1Uncaught ReferenceError: google is not defined


When I compared the <head>...</head> section of my Liferay Portal page to the GMap - Basic demo page, I found that the Google Maps JavaScript resource was not being loaded. When I added the following to the WEB-INF/liferay-portlet.xml descriptor, it started working:

1<liferay-portlet-app>
2    <portlet>
3        ...
4        <header-portal-javascript>http://maps.google.com/maps/api/js?sensor=true</header-portal-javascript>
5    </portlet>


It also worked with two p:gmap component tags on the page.
David Proba
RE: Primefaces GMap not rendering
August 31, 2012 1:26 AM
Answer

David Proba

Rank: Junior Member

Posts: 48

Join Date: June 27, 2011

Recent Posts

This does not help.... I still get
TypeError: $("script[src*=\"/javax.faces.resource/primefaces.js\"]").attr("src") is undefined

... just like still using Liferay Faces 3.1 RC1.... in fact I am using GA1
Neil Griffin
RE: Primefaces GMap not rendering
August 31, 2012 10:40 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

Hi David,

When you have time, could you start with a simple portlet project, and add the p:gmap component in such a way that it reproduces the problem?

If you are using the Liferay Maven SDK, then perhaps you could start with "mvn archetype:generate" and create a simple PrimeFaces 3 portlet from the list of archetypes. Note that you will have to modify the pom.xml in order to use the 3.1.1-ga1 version of Liferay Faces artifacts.

If you are using Liferay IDE 1.6.0, then you can do the same with File->New (Liferay Portlet). There is a new feature that lets you pick PrimeFaces when you are creating the project. See the screenshot in Greg Amerson's blog.

Neil