-
1. Re: rich:contextmenu disables right click for entire page?
sergeysmirnov May 23, 2008 12:51 PM (in response to supernovasoftware.com)Does the disableDefaultMenu="false" not help you?
-
2. Re: rich:contextmenu disables right click for entire page?
supernovasoftware.com May 23, 2008 1:01 PM (in response to supernovasoftware.com)Of course it does. How obtuse of me. For some reason the parameter name confused me at first. Not that I look at it is quite obvious.
Thanks Sergey. -
3. Re: rich:contextmenu disables right click for entire page?
supernovasoftware.com May 23, 2008 3:08 PM (in response to supernovasoftware.com)I spoke too soon. This works correctly in FF3rc1(what I am testing on), but when I deployed it I soon found that in FF2 the browser context menu appears over mine and makes it unusable.
It also shows up behind a simpletoggelpanel on the page.
1. How can I make this appear above the simpletoggelpanel?
2. How can I disable the context menu only for the button I am adding the context menu to? -
4. Re: rich:contextmenu disables right click for entire page?
sergeysmirnov May 23, 2008 3:17 PM (in response to supernovasoftware.com)the request is added to jira
http://jira.jboss.com/jira/browse/RF-3532 -
5. Re: rich:contextmenu disables right click for entire page?
supernovasoftware.com May 23, 2008 3:21 PM (in response to supernovasoftware.com)Thanks for adding it to JIRA.
1. Can you suggest a workaround for this until this is added?
2. How can I get the menu to show up above a simpletoggelpanel below it? -
6. Re: rich:contextmenu disables right click for entire page?
nbelaevski May 23, 2008 7:59 PM (in response to supernovasoftware.com)Hello Jason,
1. Possible workaround:... <h:form> <h:panelGroup id="group"> Text goes here <rich:contextMenu disableDefaultMenu="false"> <rich:menuItem value="Item 1" /> <rich:menuItem value="Item 2" /> <rich:menuItem value="Item 3" /> </rich:contextMenu> </h:panelGroup> <script type="text/javascript"> Event.observe("#{rich:clientId('group')}", "contextmenu", Event.stop); </script> </h:form> ...
2. Looks like a typical z-index issue. Two solutions are possible:
a) Move contextMenu higher to the top of the document, later than the simple toggle panel
and/or
b) Set z-index using style attribute:<rich:contextMenu style="z-index: 50;"> <rich:menuItem value="Item 1" /> <rich:menuItem value="Item 2" /> <rich:menuItem value="Item 3" /> </rich:contextMenu>
-
7. Re: rich:contextmenu disables right click for entire page?
nbelaevski May 23, 2008 8:18 PM (in response to supernovasoftware.com)Just a few things missing:
1. Re-rendering menu won't work for the code (thanks to Sergey Smirnov for pointing on that!). That will work right:<h:form> <a4j:outputPanel layout="none" id="panel"> <h:panelGroup id="group"> Text goes here <rich:contextMenu style="z-index: 50;" disableDefaultMenu="false"> <rich:menuItem value="Item 1" /> <rich:menuItem value="Item 2" /> <rich:menuItem value="Item 3" /> </rich:contextMenu> </h:panelGroup> <f:verbatim> <script type="text/javascript"> Event.observe("#{rich:clientId('group')}", "contextmenu", Event.stop); </script> </f:verbatim> </a4j:outputPanel> <a4j:commandButton reRender="panel" value="Ajax" /> </h:form>
Note that f:verbatim is necessary for facelets too, a4j:ouputPanel with "none" layout seems to be non-working without it!
2. Here is the good article on z-index bug in IE: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html describing some issues users can stuck when setting z-orders. Unfortunately, the site is down right now, looks like it's maintenance going there. -
8. Re: rich:contextmenu disables right click for entire page?
supernovasoftware.com Jun 19, 2008 7:45 PM (in response to supernovasoftware.com)I finally got around to trying your workaround.
<f:verbatim> <script type="text/javascript"> Event.observe("#{rich:clientId('panelGroupSearchMenu')}", "contextmenu", Event.stop); </script> </f:verbatim>
renders<script type="text/javascript"> Event.observe("", "contextmenu", Event.stop); </script>
probably because the context menu is in a datatable and the id looks like<span id="j_id463:dynamicVsProjectedCostReportList:2497:panelGroupSearchMenu">
How can I get this to work and look up the clientId correctly?
For now I am switching back to making the menu open onclick, but this is not the desired behavior.
Thank you for helping me.