emnadridi / gmaps4jsf

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

Re-rendering of map using richfaces a4j:push or a4j:poll #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to re-render the google map leveraging a4j:push and
a4j:poll. I'm using richfaces3.1.6 and gmaps4jsf1.1.1 deployed on
JBoss Application Server 4.0.5. 

               <f:view>
                       <h:form id="form">
                               <a4j:push interval="1000"
eventProducer="#{push.addListener}"
                                       reRender="push, grid" id="push"
enabled="true" />
                               <h:panelGroup id="grid">
                                       <m:map id="gmap"
binding="#{push.gmap}"></m:map>
                               </h:panelGroup>
                       </h:form>
               </f:view>

The map was bound a backing bean where markers were asynchronously
added to the map. 

The map was not visible (blank) when the a4j was trying to re-render. I
experienced the same behavior with both push and poll. However if I use the
browser to reload the page, the map will show up and then disappear again
when a4j re-render interval kicks in. In my prototype, I used JMS message
to asynchronously update the map (adding custom markers to the map). The
behavior that I described occurred only when you have a background thread
asynchronously updating the map and use a4j to re-render the page. If I
used the commandButton or commandLink which was visible in the page to
trigger the update, the map was re-rendered correctly because clicking the
commandButton or the commandLink forces the re-draw of the whole page.

Original issue reported on code.google.com by tritaip...@gmail.com on 21 Oct 2008 at 5:52

GoogleCodeExporter commented 9 years ago
Did u set the renderOnWindowLoad to false?

As documentation says:
"This flag determines whether to render the map on window load. This flag 
should be
set to false if the map is inside a zone that will be updated by Ajax."

Thank you!

Original comment by Hazem.sa...@gmail.com on 25 Oct 2008 at 2:33

GoogleCodeExporter commented 9 years ago
I just tried it and it works with me!!!

I will deploy the sample soon!

Original comment by Hazem.sa...@gmail.com on 26 Oct 2008 at 6:11

GoogleCodeExporter commented 9 years ago

Original comment by Hazem.sa...@gmail.com on 13 Apr 2009 at 5:52

GoogleCodeExporter commented 9 years ago

Original comment by Hazem.sa...@gmail.com on 13 Apr 2009 at 5:54