aspose file tools*
The moose likes JSF and the fly likes display a gmaps4jsf map in rich:modalpanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "display a gmaps4jsf map in rich:modalpanel" Watch "display a gmaps4jsf map in rich:modalpanel" New topic
Author

display a gmaps4jsf map in rich:modalpanel

Nigel Rowe
Greenhorn

Joined: Jun 17, 2012
Posts: 6
Hello all,
This is my web setup:
java 6
tomcat6
jsf 2.0 mojarra 2.0.3
richfaces 3.3.3 final
gmaps4jsf 3.0.0

I can do it in new page using a faces-config navigation rule with this xhtml page:


Now what I'm trying to do is do the same but this time in a rich:modalpanel, so far I've got this far with this rich:modalpanel:


The modal pops up ok but the all important map is not displayed, however the backing bean data for the map is correct(the <h2> tag is filled correctly) . Here is the code for the button that invokes the modal:

Any ideas?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

I'm sorry to say that this is a little too much info for me to digest properly (at least for free). So I'll do my old fallback and make wild suggestions in the hope that they help.

A "gotcha" in RichFaces ModalPanels is that the panel is actually formatted (rendered) when the page is initially displayed. So if you want to update parts of it before making it visible, you'll need to do a last-minute refresh of the panel first. Or at least of the components of the panel that need updating.


Customer surveys are for companies who didn't pay proper attention to begin with.
Nigel Rowe
Greenhorn

Joined: Jun 17, 2012
Posts: 6
Hello Tim
Yes I was rapidly coming to the same conclusion. I think that I have to introduce a javascript method somewhere along the line. The trouble is, where and when? I know that there is an onbeforeshow event for the modalPanel but as you stated, I have already rendered the panel in the aj4 commandButton, so maybe I should be looking to insert the javascript method there instead (maybe with an h:outputScript or something). Anyway, I am grateful for your interest in my problem. I will keep this thread alive until I have solved it.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

RichFaces uses (an antique version of) jQuery to do its AJAX work, so you can use jQuery yourself if you want to for stuff like that. But here's what I have a command button set up to do in order to request a pop-up dialog:


The button fires an AJAX listener that preps the backing bean (Model) for the dialog, then re-renders the dialog with the updated values, followed by a display of the updated dialog.
Nigel Rowe
Greenhorn

Joined: Jun 17, 2012
Posts: 6
Hi Tim,
Your a4j button does the same as mine basically and I know that all of the properties required in my modalPanel are up to date as my actionListener is fired before anything else. I think you are probably correct there about using jQuery, that's maybe the next step for me but I might just stay with the navigation rule even though I was trying to do away with them(they seem to be somewhat inelegant to me). Maybe a move up to richfaces 4 might be another choice, but that would introduce new regression problems. Anyway I digress, can you point me towards a good jQuery tutorial as I'm not too aquainted with it?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: display a gmaps4jsf map in rich:modalpanel