-
1. Re: Problems with richfaces:hotkey
lfryc Aug 14, 2012 3:06 AM (in response to dmalmeida)Hey Diego,
have you tried to place rich:hotKey outside of h:inputText.
I have doubts that new RichFaces.ui.HotKey contructor is called before txtCodigo input text element.
Also, can you see any feedback on developer console?
-
2. Re: Problems with richfaces:hotkey
dmalmeida Aug 14, 2012 11:35 AM (in response to lfryc)Hi Lukáš,
I've tried to use the hotkey component like the following snippet:
<h:body> <h:form id="aForm"> Hello from Facelets <rich:hotKey selector="#aForm" key="backspace" preventDefault="true" enabledInInput="false"/> </h:form> </h:body>
And the constructor generates, but I think it's incomplete. This is the generated code for the constructor:
new RichFaces.ui.HotKey("aForm:j_idt8", {"key":"backspace","selector":"#aForm"} );
But in the showcase, the generated code, includes something like this:
new RichFaces.ui.HotKey("j_idt239:j_idt243", {"key":"right","selector":"#j_idt239\\:pickList","onkeydown":function(event){RichFaces.ui.ComponentControl.execute(event,{"selector":null,"target":["j_idt239:pickList"] ,"callback":function(event,component){component['add'].apply(component,[] );}} ); return false;}} );
Am I missing something?
Btw, I am ussing RF 4.2.2.Final with Jboss 6 EAP.
-
3. Re: Problems with richfaces:hotkey
ppitonak Aug 17, 2012 10:12 AM (in response to dmalmeida)Hi Diego,
I managed to open a popup panel when user presses the enter key. The following code worked for me:
<h:form id="form"> <h:inputText id="txtCodigo" value="first input"/> <rich:hotKey id="richHotKey" enabledInInput="true" key="return" onkeyup="#{rich:component('popupPanel')}.show()" preventDefault="true" selector="#txtCodigo" /> <rich:popupPanel id="popupPanel" header="my popup panel">content of popup panel</rich:popupPanel> </form>
Using component control is too complicated when you can open a popup panel using its public API.
Regards,
Palo
-
4. Re: Problems with richfaces:hotkey
dmalmeida Aug 17, 2012 12:30 PM (in response to ppitonak)Thanks Pavol!
It was neccesary to add the attribute onkeyup in order to complete the contructor that generates Richfaces on javascript.
Regards
DieGo