• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Having issues reRendering a map when a rich:tree node is clicked on(SOLVED)

 
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im using a4j:repeat to dynamically generate markers on a map. I did this with the marker:



the value of that repeat tag is just a List filled with Objects. lat and lng are two variables in each Object, which is what i use for the latitude and longitude attributes in the m:marker tag.

Is it OK to use a List of Objects, or do I need to do something else like using a list of String values instead of Objects?

The other potential problem is how this List gets loaded with values. I know it is getting loaded with the correct values, because I have System.out lines of code to make sure each time the method gets called. On the left side of my page a I have a rich:tree, and the nodeSelectListener is what loads the List with values. Then I set the reRender attribute to "map", which is the id attribute on the m:map tag. <m:map width="1000px" height="750px" zoom="2" id="map">

So essentially it seems when someone clicks on the node in the rich:Tree, it should call the emthod to load the List with values, which it does just fine, but then it needs to reRender the map, but when the map gets reRendered all I see is a blank white page. If it helps, here is the rich:tree tag. Maybe I have something wrong there?



Unfortunately I only have till about 330 pm tomorrow to get this working, so I am posting this to you at 5am so I can go to bed and hope someone can spot my issue

Thanks


edit - solution I looked more clocely at the java doc for this map code, and it turns out all I needed to do was to add this to the m:map tag - renderOnWindowLoad="false"

Now it looks like this:



Now when you click on a project from the rich:tree, it reRenders the map with the markers placed on the coordinates they have.
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh goodie. GitRDun/UndethTheGun. We get more quality software that way.

The actual interactions of Java objects and JSF views (EL) is done using BeanUtils and so follows the BeanUtil rules. That usually means that any object that can be converted to or from a String is OK in an EL expression. However, in some of the RichFaces objects I've seen unhappy results.

When you get your blank page, wait about 30 seconds and then click the "Back" button. If the map appears (you may have to click "Forward"), you've run into the exact same problem I've been fighting for the last year or so (obviously that project didn't have a deadline). It's a known issue with Google Maps where apparently the internal structures aren't being set up with rigorous regard to synchronicity.

Unfortunately, I don't know of a cure. And Google doesn't seem to be working very hard on one.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it, I put the solution as an edit in my original post if you want to see what I had to do.

I'm not using rich:map or rich:gmap or whatever it is btw Tim, so maybe the map I am using will work for your issue too? It is open source so you can use it freely.

http://code.google.com/p/gmaps4jsf/
 
Tim Holloway
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The RichFaces Google Maps tag didn't exist when I wrote my stuff. I made a custom tag whose primary purpose was to render a map view and connect it to an external JavaScript.

I probably ought to look at some of the newer stuff just in case I can get the page in question to work, although it's the only map in the app that gives me trouble.
 
Matt Kohanek
Village Idiot
Posts: 484
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
edit - btw you do not have to get a google map key either, you just use the JARs this guys put on his site. But you still have all the funstionality of a google map like different view types, zooming in and out, centering over a locaton by typing in an address, plus more. Ha I sound like a commercial for this stuff

Here is one of this guys samples that connects the map to java script to pop up a window that tells you the new lat and lng when you drag and drop a marker:



Dunno if that is what you are looking for but there are a ton of examples of his map interacting with java script on that site. After all the help you've given me on this and numerous other threads it would be great if this works for you and I could help you out for once lol
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic