2 Replies Latest reply on Sep 17, 2009 6:15 AM by Kerdudou Ronan

    menuItem Action clear events ?

    Kerdudou Ronan Apprentice


      I wonder why a menuItem clears events on 'onmousedown' ans 'onmouseup' ?

      Thi cause some issues in my app because if an 'input' is being edited by a user and there is a 'onchange' on it to send the value to the server. then if the user uses a menuItem Action, then the value is never submitted (the action isn't called)

      I think the code generated for the menuItem is the cause of the problem :
      onmousedown="Event.stop(event); "
      onmouseup="Event.stop(event); "

      To have a correct comportement of the appli, the user must manually blur the input before taking action in the menuItem.

      Solution 1 : remove Event.stop from menuItem
      Solution 2 : force blur on any form component when using the menuItem

      Note that menuItems are used for global Menu of the app, but also in tables on each rows to give full options to interact with the row.
      So this second case is comonly used by users.
      (the subition of the value is temporarily resolved by removing ajaxSingle on the menuItem, but in some case the 'onchange' of the input also need to call a specific action, and then we have no solution for the issue.

      Thanks in advance for any suggestion...

      exemple code :

       <h:inputText styleClass="input"
       <a4j:support event="onchange"
       <f:setPropertyActionListener target="#{handler.paramForNotifyChange}" value="#{rowItem}"/>
       <rich:dropDownMenu direction="bottom-left" jointPoint="br" hideDelay="300">
       <f:facet name="label">
       <h:graphicImage value='#{icones["MoreAction"]}'/>
       <rich:menuItem value="Do Something"
       <a4j:actionparam assignTo="#{handler.paramId}" value="#{rowItem.id}" name="idItem" />