-
1. Re: Backspace Hotkey not disabling in Richfaces Modal
lfryc Mar 31, 2011 4:39 AM (in response to langer123)Hello Thomas,
what browser and what version of RichFaces do you use?
I have tried on IE8 with RF 3.3.3.Final and it works also when modal shown:
<h:inputText /> <rich:hotKey key="backspace" handler="return false;" disableInInput="true" /> <rich:modalPanel id="mpTest" minWidth="325" minHeight="225" zindex="2000" showWhenRendered="true"> <h:inputText /> </rich:modalPanel>
-
2. Re: Backspace Hotkey not disabling in Richfaces Modal
langer123 Mar 31, 2011 7:40 AM (in response to lfryc)HI Lucas
I'm using Richfaces 3.3.3 and JSF 2.0.4.
One thing i just noticed in the tomcat 7 console on startup is the following:
INFO: Initializing Mojarra (1.2_15-b01-FCS) for context '/myApp'
Does this mean that it's using JSF 1.2 for some reason?
Thanks
-
3. Re: Backspace Hotkey not disabling in Richfaces Modal
lfryc Mar 31, 2011 7:53 AM (in response to langer123)Yes, it means you are using JSF 1.2:
- check what libraries do you have on classpath ${WAR}/WEB-INF/lib
- if you are using JBoss AS, it already provides JSF api and impl for you
- you need to force it to use new version (overwrite JSF api and impl in server/default/deploy/jbossweb.sar/jsf-libs/
Anyway the JSF impl should not influence the hotkey behavior, I will check though.
-
4. Re: Backspace Hotkey not disabling in Richfaces Modal
lfryc Mar 31, 2011 7:53 AM (in response to langer123)What browser are you using?
-
5. Re: Backspace Hotkey not disabling in Richfaces Modal
langer123 Mar 31, 2011 7:57 AM (in response to lfryc)Firefox 4 and IE8, same problem in both.
-
6. Re: Backspace Hotkey not disabling in Richfaces Modal
langer123 Mar 31, 2011 9:54 AM (in response to langer123)Ok. I've managed to narrow it down (I'm using with JSF 1.2 by the way)
It seems that the problem happens when the modal opens for the first time. If you do not click/tab into it, pressing the backspace will return to previous page (Not behaviour I want).
If you click anywhere in the modal screen, and then select the backspace it works (Backspace disabled).
So what I need is to give focus to some element in the modal screen. The only form element my modal screen has is a textarea that is readonly, so I do not want to set the focus in this.
How can I set the focus on the modal screen?
The following does not seem to work (I think it might something to do with non-form elements not having a tab index and therefore not getting focus)
<rich:hotKey key="backspace" handler="return false;" disableInInput="true" />
<rich:modalPanel id="mpTest" minWidth="325" minHeight="225" zindex="2000" showWhenRendered="true" onshow="document.getElementById('mpTest').focus();">
<h:inputTextarea id="description" ....>
</rich:modalPanel>
-
7. Re: Backspace Hotkey not disabling in Richfaces Modal
lfryc Apr 1, 2011 4:13 AM (in response to langer123)Since modal panel itself can't get focus, you can surely focus textArea:
document.getElementById('description').focus();
I have tried and it works for me
-
8. Backspace Hotkey not disabling in Richfaces Modal
langer123 Apr 1, 2011 5:08 AM (in response to lfryc)I really dont want to set the focus in the text area. It is a readonly element and dont want a cursor there, with the user thinking they can add text.
Also, the backspace hotkey is still not disabled in IE8 when the focus is inside a modal readonly textarea (Works fine for firefox 4).
Maybe this has become a different issue at this stage? (More related to javascript and html)