-
1. Re: Workaround for rich:contextmenu and hotkey in richfaces4
andreas.hartmann Aug 31, 2011 5:52 AM (in response to sarocks)Hi Saroj,
we tried the following javascript https://github.com/jeresig/jquery.hotkeys/blob/master/jquery.hotkeys.js
It is compatible with jquery 1.4.2 + but hotkeys are not functional in input elements. so this could be useless :-(
<composite:interface> <composite:attribute name="key" required="true" type="java.lang.String" shortDescription="key definition like esc or ctrl+x" /> <composite:attribute name="handler" required="true" type="java.lang.String" shortDescription="javasript function" /> </composite:interface> <composite:implementation> <!-- FIX from https://github.com/jeresig/jquery.hotkeys --> <h:outputScript target="head" name="jquery.js" /> <h:outputScript target="head" library="script" name="jquery.hotkeys.js" /> <rich:jQuery selector="document" query="bind('keypress','#{cc.attrs.key}', #{cc.attrs.handler})" /> </composite:implementation>
has anyone a better solution?
-
2. Re: Workaround for rich:contextmenu and hotkey in richfaces4
six-p4ck Aug 31, 2011 9:34 AM (in response to andreas.hartmann)I use this to make it's work:
http://www.openjs.com/scripts/events/keyboard_shortcuts/
U can include the file without JS error and make some JS stuff.
But with a4j:jsfunction doesn't work.
-
3. Re: Workaround for rich:contextmenu and hotkey in richfaces4
pjotrovsky Oct 13, 2011 10:11 AM (in response to sarocks)context menu inside a data table:
{code:xml}
<rich:column>
<a4j:commandLink oncomplete="#{rich:component('contextMenu')}.show();" execute="@this" render="contextMenu" immediate="true" limitRender="true">
<a4j:param name="display" value="block" assignTo="#{contextMenu.display}"/>
<a4j:param name="left" value="event.clientX" assignTo="#{contextMenu.left}" noEscape="true" />
<a4j:param name="top" value="event.clientY" assignTo="#{contextMenu.top}" noEscape="true" />
<h:graphicImage library="images" name="arrow.gif" style="border: none;" />
</a4j:commandLink>
</rich:column>
{code}
<rich:dropDownMenu id="contextMenu" mode="ajax"
style="position:absolute; top:#{contextMenu.top}px; left:#{contextMenu.left}px"
popupWidth="175" horizontalOffset="8" verticalOffset="-5">
<rich:menuItem label="Item 1"/>
<rich:menuSeparator />
<rich:menuItem label="Item 2"/>
</rich:dropDownMenu>
-
4. Re: Workaround for rich:contextmenu and hotkey in richfaces4
juangon Oct 16, 2011 12:21 PM (in response to pjotrovsky)Wow!
Thanks very much for your workaround Pjotr!,
Only it should appear on context menu event, at that point would have the same behaviour as rich:contextmenu. I suppose this should be added in oncontextmenu event instead....
-
5. Re: Workaround for rich:contextmenu and hotkey in richfaces4
pjotrovsky Oct 17, 2011 4:38 AM (in response to juangon)YW (;)
I`m currently wishfully waiting for the contextMenu to be migrated to RF4.
You can watch and vote for it: https://issues.jboss.org/browse/RF-10197
-
6. Re: Workaround for rich:contextmenu and hotkey in richfaces4
juangon Oct 17, 2011 7:38 AM (in response to pjotrovsky)Yeah, I've voted some weeks ago already. Unfortunately votes in this issue isn't taken in account due to other work in RF 4.1 version.