3 Replies Latest reply on Feb 25, 2008 11:07 AM by Paul Iov

    Help: input inside of popUpMenu - JS exception in Firefox

    Paul Iov Newbie

      Hi all,

      i'm tying to put an input element inside of <rich:menuItem>.
      It works great in IE but throws the following JS exception in Firefox:

      Firebug console:
      in: a4j_3_1_4.GAorg.ajax4jsf.javascript.AjaxScript.faces
      [Exception... "'Die Erlaubnis für den Aufruf der Methode HTMLDivElement.compareDocumentPosition wurde verweigert'
      when calling method: [nsIDOMEventListener::handleEvent]"
      nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)"
      location: "" data: no]

      (Message translated is something like: "Call to ... not permitted")

      getElementsByTagName("INPUT", span#ajax-view-state) (line 36)
      processResponse(Object _query=Object _documentElement=html options=Object) (line 77)
      enviroment: RichFaces3.1.4GA / Firefox

      Exception is thrown 3 times after mouse entering the input's rectangle and then 3 times on mouse out (maybe it is mouseover of underlying menu item element?). Anyway this exception seems to break the chain of menu's mouse event handlers and the menue becomes not hidden even if mouse pointer leaves the menue rectangle. Normal "behaviour" is then restored again on any successfull mouseover event of menue. Another side effect is that if this ocures inside of shown menuGroup (see screenshot), this group becomes hidden, but the focus remains by focused input (if some was focused) and the keyboard events are still sent to it.

      The same effect is also if i place any form input element in other rich popup elements such as ToolTip.

      My code is like this:

       <rich:dropDownMenu id="menu#{ContainerList.humanName}" submitMode="none" value="Test">
       <!-- RENAME CONTAINER -->
       <rich:menuItem submitMode="none" rendered="#{ContainerList.current.nameEditable}">
       <f:facet name="icon">
       <h:graphicImage value="module/gridoptionbar/images/red_edit.gif" />
       <!-- input -->
       <h:inputText value="#{ContainerList.humanName}" id="edContainerName" />
       <!-- invisible default submit button to hanle "Enter" -->
       <a4j:commandButton actionListener="#{ContainerList.stateChangeListener}" value=""
       <!-- EMAIL -->
       <rich:menuGroup value="Email">
       <f:facet name="icon">
       <h:graphicImage value="module/gridoptionbar/images/red_email.gif" />
       <rich:menuItem submitMode="none" disabled="true" value="#{gridstrings.mail_to}:">
       <h:inputText value="#{ContainerList.current.mailTo}" />
       <rich:menuItem submitMode="none" disabled="true" value="#{gridstrings.mail_cc}:">
       <h:inputText value="#{ContainerList.current.mailCC}" />
       <rich:menuItem submitMode="none" disabled="true" value="#{gridstrings.mail_message}:" />
       <rich:menuItem submitMode="none" disabled="true" value="" >
       <h:inputTextarea value="#{ContainerList.current.mailBody}" />
       <rich:menuItem submitMode="ajax" actionListener="#{ContainerList.current.emailListener}"
       oncomplete="#{! empty facesContext.maximumSeverity ? 'DoMessagePopUp()' : ''}">
       <f:facet name="icon">
       <h:graphicImage value="module/gridoptionbar/images/red_right.gif" />

      Is there any solution or workaround for this problem?