Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSF Icefaces: map disappear on refresh #166

Open
GoogleCodeExporter opened this issue Mar 23, 2016 · 10 comments
Open

JSF Icefaces: map disappear on refresh #166

GoogleCodeExporter opened this issue Mar 23, 2016 · 10 comments

Comments

@GoogleCodeExporter
Copy link

Hi guys,
I've a problem with gmaps4jsf map. In my application I need a map where I 
dinamically insert some markers. This is my xhtml: 

<m:map id="MAP" binding="#{deliveriesProgress.map}" />

Then, in my backing bean, I create object map = new Map() ... I set some 
properties, like latitude, longitude, zoom and I insert marker in this way: 

marker = new Marker();
marker.setLatitude("43.5436");
marker.setLongitude("10.317");
HTMLInformationWindow ballon = new HTMLInformationWindow();
        ballon.setHtmlText("Latitudine: 43.5436 - Longitudine: 10.317");
        marker.getChildren().add(ballon);
        map.getChildren().add(marker);

When I enter into the page the map is correctly displayed, but if I refresh the 
page, the map disappear.

Have you any idea to solve this problem?

Thank you,
Chiara

Original issue reported on code.google.com by [email protected] on 5 May 2011 at 10:41

@GoogleCodeExporter
Copy link
Author

I found I obtain javascript error when map disappear:
gmaps4jsf is null or not an object

Original comment by [email protected] on 5 May 2011 at 12:29

@GoogleCodeExporter
Copy link
Author

This code is in the getter of the binding?

Original comment by [email protected] on 9 May 2011 at 5:43

@GoogleCodeExporter
Copy link
Author

Yes, the code is in the getter of the binding.

Original comment by [email protected] on 9 May 2011 at 5:47

@GoogleCodeExporter
Copy link
Author

Do you use AJAX Push for refreshing?

Maybe this can help: http://icecube-on-icefusion.googlecode.com/ 

http://code.google.com/p/icecube-on-icefusion/source/browse/trunk/src/main/webap
p/icecube/push/game.xhtml

(http://code.google.com/p/icecube-on-icefusion/source/browse/trunk/src/main/weba
pp/icecube/presentation/googleMap.xhtml)

Original comment by rainwebs on 28 Jun 2011 at 4:54

@GoogleCodeExporter
Copy link
Author

Hi, cbo...,

I found a solution for F5 refresh problem for configuration jsf 1.2 with 
icefaces 1.8.2:

1. Copy three .js files from gmaps4jsf 1.1.4 library's META-INF package to your 
server directory where they would be accessible by client.

2. Add to your page's head section three references to these files like 
<script src="/your-page-url/resources/gmaps4jsf.js" 
type="text/javascript"></script>

That's it!

This guarantees that javascript functions reguired to render a map are included 
in the page even after refresh which is not the case if they are in library 
only.

Good luck!

Original comment by [email protected] on 8 Jul 2011 at 12:01

@GoogleCodeExporter
Copy link
Author

Hi v.g.vi...,

I tried to apply your solution but it didn't solve my problem. At the moment I 
can see the map without any disappear using a workaround:  every time that I 
need to show the map I call a "window.location.reload(true)".

I'm using gmaps4jsf 1.1.3-u3.jar (I tried the solution with gmaps4jsf _1.1.4, 
but it did not work).

Thank you,
Chiara

Original comment by [email protected] on 12 Jul 2011 at 8:45

@GoogleCodeExporter
Copy link
Author

Hello I'm using Icefaces 2.0.2 and I need integrate gmaps4jsf1.1.4. When run my 
application, my page can show the map but when I try to use a actionListener on 
map or other communication with server, my map disappear. I am using my project 
without AJAX Push, but nothing ...Help me Please..!!
Thank you,
Marlon

Original comment by [email protected] on 14 Jul 2011 at 4:38

@GoogleCodeExporter
Copy link
Author

Any comments about version 1.1.4 and map disappearing by ajax update? I am 
trying to use component by 100% dynamically markup generation. No luck. 
window.location.reload(true) - not a solution. 
    map.setPartiallyTriggered("true") or    map.setPartiallyTriggered("false") no affect to map behavior....
This is very major issue

Original comment by [email protected] on 5 Aug 2011 at 7:17

@GoogleCodeExporter
Copy link
Author

Sorry for late response. The gmap-page refresh problem in icefaces is
solved simply by adding to the page header references to all .js files
contained in gmaps4jsf library. This ensures every icefaces rendering
triggers request to google maps. Icefaces itself doesn't know about gmaps,
it just renders what is in the page file.

Thanks!

Original comment by [email protected] on 31 Jan 2012 at 2:00

@GoogleCodeExporter
Copy link
Author

I added the three js files, and now, when my map is loaded the first time is 
not visible; if I refresh the page the map appears (and also for each other 
refresh)
If I remove the js files inclusion the first time there is the map and for each 
refresh the map disappears
I'm using Icefaces 1.8.2 with facelets 
Thanks!!

Original comment by [email protected] on 10 Feb 2012 at 5:53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant