[richfaces-issues] [JBoss JIRA] (RF-11967) rich:contextMenu can't be attached to body

Brian Leathem (JIRA) jira-events at lists.jboss.org
Fri Mar 23 01:21:48 EDT 2012


     [ https://issues.jboss.org/browse/RF-11967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-11967:
-------------------------------

             Fix Version/s: 4.Future
                                (was: 4.2.1.CR1)
    Workaround Description: 
Wrap your content in a top level div, as in:

{code}
<h:body style="margin: 0; padding: 0; border: 0;">
    <h:panelGroup layout="block" id="mybody" style="position:absolute; width:100%; top:0; bottom: 0;background-color:#EEEEEE;">
        ....
    </h:panelGroup>
</h:body>
{code}


This is currently not possible, as the parent is looked up by id.  The id is then fed into document.getElementById before being fed to jQuery as a selector, to overcome the JSF id separator problem with jQuery.  However, document.getElementById returns null when you try to look up the body by id.

To overcome this, we will have to come up with a better means of looking up and attaching to the parent.

See the workaround of introducing an extra div in your html to hold the contextMenu.
                
> rich:contextMenu can't be attached to body
> ------------------------------------------
>
>                 Key: RF-11967
>                 URL: https://issues.jboss.org/browse/RF-11967
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-menu
>    Affects Versions: 4.2.0.CR1
>            Reporter: Rene O
>            Assignee: Brian Leathem
>             Fix For: 4.Future
>
>
> I haved tried to attach the contextMenu to the body element
> {code:title=example.xhtml}
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
>     xmlns:h="http://java.sun.com/jsf/html"
>     xmlns:f="http://java.sun.com/jsf/core"
>     xmlns:ui="http://java.sun.com/jsf/facelets"
>     xmlns:a4j="http://richfaces.org/a4j"
>     xmlns:rich="http://richfaces.org/rich">
>     
>     <h:head >    
>         <title>example</title>        
>     </h:head>
>     <h:body id="mybody" style="width:100%;height:100%;background-color:#EEEEEE;">    
>       
>        <h:outputText value="contextMenu appears only if i right-click here" />
>        
>        <rich:contextMenu id="myContext" attached="true" target="mybody" mode="client">
>       			<rich:menuItem>
>       				contextMenuItem
>       			</rich:menuItem>      			
>       	</rich:contextMenu>
>     </h:body>
> </html>
> {code}
> The contextMenu only appears if i right-click the outputText. If i right-click somewhere else inside the page the contextMenu doesn't appear. I think, that this is a bug. I want the contextMenu all over the site.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list