Gmap is not working

UI Components for JSF
Post Reply
srinivas1985
Posts: 4
Joined: 03 Jul 2011, 17:59

03 Jul 2011, 18:05

Hi,
I am new to primefaces and trying out gmap .But it is not working.
I have tried using gmap both inside tab and outside of it.But it is not rendering.
I checked in most of the places but couldnt find a solution.I am posting my code below.
Please help me out.Am i missing something for the gmap?


<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:f="http://java.sun.com/jsf/core">
<h:head>
<title>Currency Converter</title>
<h:outputStylesheet library="css" name="styles.css"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sens ... "></script>

</h:head>
<h:body styleClass="yui-skin-sam" style=" color: #616161;
font-size: 12px;
margin: 0;
padding: 0;">
<h1 align="center">Currency Converter</h1>
<p:tabView dynamic="true" cache="true" effect="opacity" effectDuration="normal" activeIndex="#{bean.activeTabIndex}" >

<p:tab title="Converter" id="converter">
<h:form >
<h:panelGrid columns="2" cellpadding="30">
<h:panelGroup>
<h:panelGrid columns="3" cellpadding="0">

<h:outputText value="Amount" styleClass="fontStyle"/>
<h:inputText label="Amount" value="#{bean.amountString}" id="amount" valueChangeListener="#{bean.amountListener}" size="19" >
<f:ajax event="keyup" execute="@this" render="messageAmount" />
</h:inputText>

<h:outputText id="messageAmount" styleClass="error" value="#{bean.amountError}" />


<h:outputText value="From:" styleClass="fontStyle" />
<h:selectOneMenu label="From" value="#{bean.fromCurrency}" id="fromCurrencyMenu" onchange="submit()" valueChangeListener="#{bean.fromValueChangeListener}" styleClass="fontStyle" immediate="true">
<f:selectItems value="#{bean.currencyList}" />
</h:selectOneMenu>
<h:panelGroup>
<h:graphicImage id="fromImg" library="images" name="#{bean.fromCurrencyFlag}.png" />
<h:outputText id="messageFrom" styleClass="error" value="#{bean.fromError}"/>
</h:panelGroup>

<h:outputText value="To:" styleClass="fontStyle" />
<h:selectOneMenu label="To" value="#{bean.toCurrency}" id="toCurrencyMenu" onchange="submit()" valueChangeListener="#{bean.toValueChangeListener}" styleClass="fontStyle" immediate="true">
<f:selectItems value="#{bean.currencyList}"/>
</h:selectOneMenu>
<h:panelGroup>
<h:graphicImage id="toImg" library="images" name="#{bean.toCurrencyFlag}.png" />
<h:outputText id="messageTo" styleClass="error" value="#{bean.toError}"/>
</h:panelGroup>
<br/><br/>
<h:panelGroup>
<h:commandButton value="Convert" action="#{bean.convertCurrency(0)}" />
<h:commandButton value="Clear" action="#{bean.clearAction(0)}" />
</h:panelGroup>
</h:panelGrid>
</h:panelGroup>
<p:panel id="conversionResultPanel" header="Conversion Result" toggleable="true" closable="true"
toggleSpeed="500"
closeListener="#{bean.handleCloseForResult}"
onCloseUpdate="growl" closeSpeed="1000"
widgetVar="panel" rendered="#{bean.convertedState}" >
<h:panelGroup >
<h:panelGrid columns="2" cellpadding="10">
<h:graphicImage library="images" name="#{bean.currency.code}.png" />
<h:graphicImage library="images" name="#{bean.currency.convertCode}.png" />
<h:outputText value="#{bean.currency.amount} #{bean.currency.code} =" />
<h:outputText value="#{bean.currency.convertAmount} #{bean.currency.convertCode}" />
</h:panelGrid>
</h:panelGroup>
</p:panel>
</h:panelGrid>


</h:form>
</p:tab>
<h:form>

<p:growl id="growl" showDetail="true"/>
<f:view contentType="text/html">

<p:gmap ccenter="36.890257,30.707417" zoom="13" type="HYBRID"
style="width:600px;height:400px" />
</f:view>
</h:form>

srinivas1985
Posts: 4
Joined: 03 Jul 2011, 17:59

04 Jul 2011, 08:37

The problem is identified. Typo Error in <p:gmap center ...>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 32 guests