m:map won't display in a JBoss Seam Facelet

57 views
Skip to first unread message

NOTiFY

unread,
Nov 30, 2009, 12:45:06 PM11/30/09
to gmaps4jsf-dev
I'm using JBoss Seam v.2.2.0.GA with Facelets (XHTML) deployed on
JBoss v.4.2.3.GA as an EAR file.

The only way I can currently get my m:map to display is add a dummy
map after it like so;

<h:panelGrid id="NOTiFYPiNPOINTpanelGrid" columns="1" style="width:
100%">
<m:map
mapType="G_NORMAL_MAP"
latitude="#{latitude}"
longitude="#{longitude}"
zoom="13"
gmapVar="map"
width="width:100%"
height="500px"
renderOnWindowLoad="false"
rendered="#{latitude ne null and longitude ne
null}"
id="NOTiFYPiNPOINTmap">

<m:mapControl name="GLargeMapControl"
position="G_ANCHOR_BOTTOM_LEFT"/>
<m:mapControl name="GMapTypeControl"/>

<a4j:repeat value="#{pinPointsList}"
var="pinpoints">
<m:marker latitude="#{pinpoints.latitude}"
longitude="#{pinpoints.longitude}">
<m:htmlInformationWindow htmlText="#
{pinpoints.deviceDateTime} Latitude = #{pinpoints.latitude} Longitude
= #{pinpoints.longitude}"/>
</m:marker>
</a4j:repeat>
</m:map>
</h:panelGrid>


<rich:gmap gmapKey="ABQIAAAAgiNNSEpcz5q7mruleySC6RRc6qmiA-
g9mt16aVfJwib-tiHt_hTRSSSqgVoLBj20zGqtn5m8J6ZtYw" />

Have you any examples of the m:map working under Seam?

Thanks.

Hazem Saleh

unread,
Nov 30, 2009, 1:21:04 PM11/30/09
to gmaps4...@googlegroups.com
Yes it works with Seam. please make sure that you put:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAtRLgopSfFn_inKV4Mb4dwRQrh986W3YN5ROngdOVRv-81htxfBSHsTcVUm4HRkCt9bSp5mP_3_snrw"
type="text/javascript"></script>

in the <head> of your page.

Check this discussion:
http://code.google.com/p/gmaps4jsf/wiki/FaceletsSupport

by condesales.
> --
>
> You received this message because you are subscribed to the Google Groups "gmaps4jsf-dev" group.
> To post to this group, send email to gmaps4...@googlegroups.com.
> To unsubscribe from this group, send email to gmaps4jsf-de...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/gmaps4jsf-dev?hl=en.
>
>
>



--
Hazem Ahmed Saleh Ahmed

Author of (The Definitive Guide to Apache MyFaces and Facelets):
http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/1590597370
http://www.amazon.com/-/e/B002M052KY

Web blog: http://www.jroller.com/page/HazemBlog

[Web 2.0] Google Maps Integration with JSF:
http://code.google.com/p/gmaps4jsf/
http://www.ibm.com/developerworks/library/wa-aj-gmaps/

NOTiFY

unread,
Nov 30, 2009, 2:19:55 PM11/30/09
to gmaps4jsf-dev
Sorry I didn't include all my code.

I am using IE8 with IE7 compatability set.

I have;


<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /
>
<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAgiNNSEpcz5q7mruleySC6RRc6qmiA-
g9mt16aVfJwib-tiHt_hTRSSSqgVoLBj20zGqtn5m8J6ZtYw" type="text/
javascript"></script>
</head>



Full code;

<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:m="http://code.google.com/p/gmaps4jsf/"
template="layout/template.xhtml">

<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /
>
<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAgiNNSEpcz5q7mruleySC6RRc6qmiA-
g9mt16aVfJwib-tiHt_hTRSSSqgVoLBj20zGqtn5m8J6ZtYw" type="text/
javascript"></script>
</head>

<body onunload="GUnload()">

<f:view contentType="text/html"></f:view>
<ui:define name="body">

<h1>NOTiFY PiNPOiNT beta</h1>

<h:form id="mapForm">

<script>
function selectedDevicesToTrackChanged() {
alert('selectedDevicesToTrackChanged()');
}

function selectedDateFromChanged() {
alert('selectedDateFromChanged()');
}

function selectedDateToChanged() {
alert('selectedDateToChanged()');
}
</script>

<rich:panel style="width:100%; height:100%;"
id="NOTiFYPiNPOINTpanel">

<h:panelGroup id="NOTiFYPiNPOINTpanelGroup">
<h:panelGrid columns="10">

<h:outputLabel for="devicesToTrack">Device to track</
h:outputLabel>
<h:selectOneMenu value="#
{devicesToTrackBean.devicesToTrack}" required="true"
id="devicesToTrack" >
<s:selectItems value="#{devicesToTrackList}"
var="devicesToTrack" label="#{devicesToTrack.vehicleAllocatedTo}" />
<s:convertEntity/>
<a4j:support event="onchange" action="#
{devicesToTrackBean.getDevicesToTrackCurrentLocation()}"
reRender="NOTiFYPiNPOINTpanelGrid" />
</h:selectOneMenu>
<rich:message for="devicesToTrack">
</rich:message>

<h:outputLabel for="selectedDateFromCalendar">Date
from</h:outputLabel>
<rich:calendar name="selectedDateFromCalendar"
id="selectedDateFromCalendar" label="selectedDateFrom" value="#
{calendarBean.selectedDateFrom}" datePattern="#{calendarBean.pattern}"
popup="true" >
<a4j:support event="onchanged" action="#
{devicesToTrackBean.getDevicesToTrackCurrentLocation()}"
reRender="NOTiFYPiNPOINTpanelGrid" />
</rich:calendar>
<rich:message for="selectedDateFrom">
</rich:message>

<h:outputLabel for="selectedDateToCalendar">Date
to</h:outputLabel>
<rich:calendar name="selectedDateToCalendar"
id="selectedDateToCalendar" label="selectedDateTo" value="#
{calendarBean.selectedDateTo}" datePattern="#{calendarBean.pattern}"
popup="true" >
<a4j:support event="onchanged" action="#
{devicesToTrackBean.getDevicesToTrackCurrentLocation()}"
reRender="NOTiFYPiNPOINTpanelGrid" />
</rich:calendar>
<rich:message for="selectedDateTo">
</rich:message>
</h:panelGrid>

</h:panelGroup>
</rich:panel>
</h:form>

</ui:define>

</body>

</ui:composition>
<!--
<a4j:support event="onchange" action="#
{devicesToTrackBean.getDevicesToTrackCurrentLocation()}"
reRender="NOTiFYPiNPOINTpanelGrid"
oncomplete="selectedDevicesToTrackChanged()" />
<h:selectOneMenu value="#
{piNPOiNTDevicesToTrackBean.selectedDevicesToTrack}"
id="devicesToTrack" >
-->

On Nov 30, 6:21 pm, Hazem Saleh <hazem.sa...@gmail.com> wrote:
> Yes it works with Seam. please make sure that you put:
>
> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAtRLgopSf..."
> > For more options, visit this group athttp://groups.google.com/group/gmaps4jsf-dev?hl=en.
>
> --
> Hazem Ahmed Saleh Ahmed
>
> Author of (The Definitive Guide to Apache MyFaces and Facelets):http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/159...http://www.amazon.com/-/e/B002M052KY
>
> Web blog:http://www.jroller.com/page/HazemBlog
>
> [Web 2.0] Google Maps Integration with JSF:http://code.google.com/p/gmaps4jsf/http://www.ibm.com/developerworks/library/wa-aj-gmaps/- Hide quoted text -
>
> - Show quoted text -

NOTiFY

unread,
Nov 30, 2009, 2:26:08 PM11/30/09
to gmaps4jsf-dev
By the way I'm using GMaps4JSF 1.1.2 and I have tried it with the
1.1.3 snap shot.

According the website the configuration is not required.


On Nov 30, 6:21 pm, Hazem Saleh <hazem.sa...@gmail.com> wrote:
> Yes it works with Seam. please make sure that you put:
>
> <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAtRLgopSf..."
> > For more options, visit this group athttp://groups.google.com/group/gmaps4jsf-dev?hl=en.
>
> --
> Hazem Ahmed Saleh Ahmed
>
> Author of (The Definitive Guide to Apache MyFaces and Facelets):http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/159...http://www.amazon.com/-/e/B002M052KY
>
> Web blog:http://www.jroller.com/page/HazemBlog
>

Hazem Saleh

unread,
Nov 30, 2009, 3:36:10 PM11/30/09
to gmaps4...@googlegroups.com
please send me a sample war to solve your problem directly.

I wish it can work on Tomcat :).
> For more options, visit this group at http://groups.google.com/group/gmaps4jsf-dev?hl=en.
>
>
>



--
Hazem Ahmed Saleh Ahmed

Author of (The Definitive Guide to Apache MyFaces and Facelets):
http://www.amazon.com/Definitive-Guide-Apache-MyFaces-Facelets/dp/1590597370

dapooley

unread,
Dec 1, 2009, 6:33:44 AM12/1/09
to gmaps4jsf-dev
I use Seam and facelets as well and dont have this problem. My
difference is that my key GLoad is in the template that all pages use,
so it has been well executed before the User gets to the page with the
map on it. I also think randomish pages not coming up is because of
this as the call to google can take a while.

NOTiFY

unread,
Dec 1, 2009, 7:42:56 AM12/1/09
to gmaps4jsf-dev
Thanks for that.

Moved;

<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;key=ABQIAAAAgiNNSEpcz5q7mruleySC6RRc6qmiA-
g9mt16aVfJwib-tiHt_hTRSSSqgVoLBj20zGqtn5m8J6ZtYw" type="text/
javascript"></script>

to template.xhtml

and removed the "dummy" GMap.

The map is displaying fine, Hazem close the case!

Regards,

Roger

dapooley

unread,
Dec 1, 2009, 8:47:08 PM12/1/09
to gmaps4jsf-dev
great. lol - why is this the case though that some kind of pre-
initialisation is required?
Reply all
Reply to author
Forward
0 new messages