darshakshah1988 / gmaps4jsf

Automatically exported from code.google.com/p/gmaps4jsf
0 stars 1 forks source link

gmap4jsf, richfaces ajax update #104

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi
I'm using this environment:
1) Richfaces 3.3.2
2) Spring 3.0
3) JVM 1.6
4) Apache tomcat 6.0.24
5) gmaps4jsf1.1.3
6) JSF1.2 (Mojarra impl)
7) Facelets

I'm newbie in richfaces and gmap4jsf.
I wrote this code:
template.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html" 
xmlns:f="http://java.sun.com/jsf/core"
                xmlns:rich="http://richfaces.org/rich" 
xmlns:a4j="http://richfaces.org/a4j">

    <head>
        <title>
        <a4j:loadBundle var="msg" basename="messages"/>
            <h:outputText value="#{msg.applicationTitle}" />            
        </title>
        <meta http-equiv="Content-Type" content="text/html; 
charset=iso-8859-1" />
    </head>
    <body>
        <div class="section">
            <div class="section">
                <ui:insert/>
            </div>
        </div>
    </body>
</html>

search.xhtml:
<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html" 
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:rich="http://richfaces.org/rich" 
                xmlns:a4j="http://richfaces.org/a4j"

xmlns:m="http://code.google.com/p/gmaps4jsf/"
                template="/template.xhtml">

<a4j:form>
        <h:panelGrid columns="2" title="#{msg.searchPerformance}" 
id="ricercaPrestazioni">
            <h:outputLabel id="performanceName" for="performanceName" 
value="#{msg.performanceName}" />
            <h:inputText value="#{searchBean.nomePrestazione}" 
id="nomePrestazione" />
            <h:outputLabel id="perfomanceDescription" 
for="descrPrestazione" value="#{msg.descrizionePrestazione}" />
            <h:inputText value="#{searchBean.descrizionePrestazione}" 
id="descrPrestazione" />
            <a4j:commandButton value="#{msg.ricerca}" 
action="#{searchBean.doSearch}" reRender="table" />
        </h:panelGrid>
    </a4j:form>
    <rich:spacer height="7"/>
    <br />
    <a4j:form id="contenitoreDeiDati">
<h:panelGrid columns="2" columnClasses="top , top" >
 <rich:extendedDataTable
                value="#{searchBean.prestazioniDataModel}" 
var="prestazione" id="table"
                width="580px" height="400px"
                sortMode="#{searchBean.sortMode}"
                selectionMode="#{searchBean.selectionMode}"
                tableState="#{searchBean.tableState}"
                selection="#{searchBean.selection}" >
                <rich:column sortable="true" 
sortBy="#{prestazione.idPrestazione}" id="col_2"
                    filterBy="#{prestazione.idPrestazione}" 
filterEvent="onkeyup" width="170px"
                    label="#{msg.performanceId}">
                    <f:facet name="header">
                        <h:outputText value="#{msg.performanceId}" 
id="performanceId"/>
                    </f:facet>
                    <h:outputText value="#{prestazione.idPrestazione}" 
id="prestazioneidPrestazione1"/>
                </rich:column>
                <rich:column sortable="true" 
sortBy="#{prestazione.nomePrestazione}" id="prestazioneidPrestazione2"
                    filterBy="#{prestazione.nomePrestazione}" 
filterEvent="onkeyup" width="170px"
                    label="#{msg.performanceName}">
                    <f:facet name="header">
                        <h:outputText value="#{msg.performanceName}" 
id="performanceName2"/>
                    </f:facet>
                    <h:outputText value="#{prestazione.nomePrestazione}" 
id="nomePrestazione3"/>
                </rich:column>
                <rich:column sortable="true" 
sortBy="#{prestazione.puntina.indirizzo}" 
id="prestazioneIndirizzoPrestazione2"
                    filterBy="#{prestazione.puntina.indirizzo}" 
filterEvent="onkeyup" width="170px"
                    label="#{msg.performanceAddress}">
                    <f:facet name="header">
                        <h:outputText value="#{msg.performanceAddress}" 
id="performanceAddress2"/>
                    </f:facet>
                    <h:outputText value="#{prestazione.puntina.indirizzo}" 
id="indPrestazione3"/>
                </rich:column>
                <a4j:support reRender="gmap" 
id="extended_table_bean_take_selection"

action="#{searchBean.doSelect}"

event="onselectionchange" />
            </rich:extendedDataTable>
  <h:panelGroup layout="block" style="width:100%">
             <rich:panel>
                 <f:facet name="header">
                     <h:outputText value="#{msg.localization}" />
                 </f:facet>             
                 <rich:dataTable value="#{searchBean.choosenEntities}"
                     var="sel" id="selectiontable" >
                     <rich:column>
                        <f:view contentType="text/html">
                            <h:form id="googleMapForm">
                                <!-- Prendo la chiave di google map 
-->

<m:resources key="#{sel.puntina.gmapkey}" />
                                <!-- 
Disegno la mappa -->
                                <m:map 
width="600px" 

height="400px" 

address="#{sel.puntina.indirizzo}" 

locationNotFoundErrorMessage="#{msg.notFoundPoint}"

showLocationNotFoundMessage="true"

zoom="#{sel.puntina.zoom}" 

type="G_HYBRID_MAP"

renderOnWindowLoad="false"

addStreetOverlay="true"

enableScrollWheelZoom="true"

id="gmap"

autoReshape="true"
                                > 

<m:marker address="#{sel.puntina.indirizzo}">

<m:htmlInformationWindow address="#{sel.puntina.indirizzo}" 
htmlText="#{sel.puntina.indirizzo}"/>

</m:marker> 

<m:mapControl name="GLargeMapControl" position="G_ANCHOR_BOTTOM_RIGHT"/>

<m:mapControl name="GScaleControl" position="G_ANCHOR_TOP_RIGHT"/>

<m:mapControl name="GMapTypeControl" position="G_ANCHOR_TOP_LEFT"/>

<m:mapControl name="GHierarchicalMapTypeControl" 
position="G_ANCHOR_BOTTOM_LEFT"/>

<m:mapControl name="GOverviewMapControl" position="G_ANCHOR_BOTTOM_LEFT"/> 

                                </m:map>
                            </h:form>
                        </f:view>
                     </rich:column>                                          
                 </rich:dataTable>
             </rich:panel>
</h:panelGroup>           
</h:panelGrid>
</a4j:form>
    <br />      
</ui:composition>

Now what i would like to obtain is that a user search for something, in the   
<rich:extendedDataTable component i'll show the result (all results have an 
address). When the user selects one of the result a portion of my page is 
updated and display the choosen address on google map by using gmaps4jsf 
tag library (where i inserted in the m:map component the attribute 
renderOnWindowLoad="false")
Now what i get is that when the user clicks on the selected address nothing 
happens. If i refresh the full page (by F5 button) the google map is 
desplaied but the map is not clear (i attach the file result.jpg where you 
can see the result of them map)
According to you is what i want to do possible? Where am i missing?
Moreover if i don't use the <f:view contentType="text/html"> but only 
<f:view> nothing happens at all.

Original issue reported on code.google.com by angelo...@gmail.com on 16 Mar 2010 at 12:12

Attachments:

GoogleCodeExporter commented 8 years ago
I think this is a similar example of what you want:
http://www.mashups4jsf.com/mashups4jsf-examples/pages/theater2.xhtml

Please check it and tell me if you still have this problem.

Original comment by Hazem.sa...@gmail.com on 18 Mar 2010 at 6:46

GoogleCodeExporter commented 8 years ago
Yes it's what i wanted to obtain.I'll give a look and i'll let you know.
Best regards,
 Angelo

Original comment by angelo...@gmail.com on 18 Mar 2010 at 8:40

GoogleCodeExporter commented 8 years ago
Thank you Angelo.

Kindly post your further questions to the project development mailing list.

http://groups.google.com/group/gmaps4jsf-dev

Original comment by Hazem.sa...@gmail.com on 18 Mar 2010 at 1:57

GoogleCodeExporter commented 8 years ago
Fixed

Original comment by Hazem.sa...@gmail.com on 4 Apr 2010 at 10:34