Forums Register Login

display a gmaps4jsf map in rich:modalpanel

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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?
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2048 times.
Similar Threads
Can't reRender richfaces datatable from modal panel
File browser button
Take input from <h:inputText> in rich <modalPanel>
Problem inside a richModalPanel
Ajax status doesn't stop in IE8
Why should you try IntelliJ IDEA ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:46:21.