-
1. Re: <rich:popupPanel> does not close on escape key press
michpetrov Feb 27, 2013 6:13 AM (in response to teenastanley)Hi,
this should work:
$(document).bind('keydown', 'Esc', function() { #{rich:component('mypopupPanel')}.hide(); });
yours didn't work because $("#mypopupPanel") doesn't find the popup. The id you set for the richfaces component isn't what the actual id will look like in the end (e.g. in case of the popup the topmost div will have id="mypopupPanel_container"). But the rich:component('id') function can find the components based on the original id.
As to the a4j:form, the popupPanel has to be inside one (as do almost all components) but if you already have one on the page you don't need to make another just for the panel. (I'm not sure it would even let you do it, it shouldn't allow nested forms).
-
2. Re: <rich:popupPanel> does not close on escape key press
teenastanley Feb 27, 2013 7:05 AM (in response to michpetrov)Hi Michal,
Thank you. That worked perfectly. Could you please tell me what syntax is that?
#{rich:component('mypopupPanel')}.hide();
To me it doesnt look like a jQuery/javascript syntax. I thought this is JSF EL syntax and this should not be used in the scripts.
Thanks,
Teena
-
3. Re: <rich:popupPanel> does not close on escape key press
michpetrov Feb 27, 2013 7:27 AM (in response to teenastanley)1 of 1 people found this helpfulTeena Stanley wrote:
Hi Michal,
Thank you. That worked perfectly. Could you please tell me what syntax is that?
#{rich:component('mypopupPanel')}.hide();
To me it doesnt look like a jQuery/javascript syntax. I thought this is JSF EL syntax and this should not be used in the scripts.
Thanks,
Teena
Hi,
it's EL mixed with JavaScript and it's ok to use it in scripts: the EL part will resolve to a string and JavaScript will take it from there. You'd have a hard time trying to get by without it.
-
4. Re: <rich:popupPanel> does not close on escape key press
teenastanley Feb 27, 2013 7:36 AM (in response to michpetrov)Hi Michal,
Thank you. This is really really helpful.
Cheeers,
Teena