-
1. Re: 'undefined' value of Modal Panel parameter
ilya_shaikovsky Dec 9, 2008 5:45 AM (in response to zeppelinux)change your onclick declaraion to
onclick="Richfaces.showModalPanel('modalPanelId', {width: 500, height: 300, param1: 'test parameter'});
-
2. Re: 'undefined' value of Modal Panel parameter
zeppelinux Dec 9, 2008 4:57 PM (in response to zeppelinux)It works Thanks a Lot!
But I have another problem with modal panel.
I'm trying to reuse the same modal panel for different content passing different parameters, it works pretty well except of the case when content differ in size.
The Modal panel is resized properly, but wrongly centered on the screen for the second show.
Looks like it remembers it's position from the first show and will use it till rerendered.
Is there any good way to 'reset' it from javascript? -
3. Re: 'undefined' value of Modal Panel parameter
ilya_shaikovsky Dec 10, 2008 4:57 AM (in response to zeppelinux)https://jira.jboss.org/jira/browse/RF-4983
Already there.
And b.t.w. try to use top:'auto' and left: 'auto' params defined in MP calls. -
4. Re: 'undefined' value of Modal Panel parameter
zeppelinux Dec 12, 2008 9:36 PM (in response to zeppelinux)Explicitly specifying the top:'auto' and left: 'auto' params improoves the centering, but not 100%, here is an example:
http://www.kneebracekraft.com
Click on top left and after on bottom right image... the second time clicking on the same image centers it properly. -
5. Re: 'undefined' value of Modal Panel parameter
stank0 Mar 18, 2009 11:57 AM (in response to zeppelinux)Hi,
"Zeppelinux" wrote:
Hi,
I'm trying to pass the parameters to the modal panel as it is described in the manual, but it doesn't work for me.
'param1' is always 'undefined' in onshow.
Here is the code:<f:view locale="En" contentType="text/html"> <h:graphicImage id="link" value="imagePath.jpg" onclick="Richfaces.showModalPanel('modalPanelId', {width: 500}, {height: 300}, {param1: 'test parameter'});"/> <rich:modalPanel id="modalPanelId" autosized="true" onshow="alert(event.parameters.param1);"> <h:outputText value="test modal panel parameters"/> </rich:modalPanel> </f:view>
What I'm doing wrong?
Thanks,
How would I access 'param1' if I wanted to use it in <h:outputText>?
With an EL expression?
<h:outputText value="#{param1}"/>
I need to access that value to display the title etc., not possible from within Javascript.
Thank you in advance. -
6. Re: 'undefined' value of Modal Panel parameter
zeppelinux Mar 18, 2009 3:27 PM (in response to zeppelinux)did you tried to use JavaScript in 'onshow' :
onshow="document.getElementById('yourTitleId').innerHTML=event.parameters.titleParam;"
-
7. Re: 'undefined' value of Modal Panel parameter
stank0 Mar 19, 2009 2:56 AM (in response to zeppelinux)
That works. I guess there is no way to avoid JS? Maybe I find a workaround with <a4j:actionParam> for the modal panel to retrieve parameters as non-JS.
Thank you for your help.