3 Replies Latest reply: Feb 5, 2013 2:36 AM by David Pérez Martín RSS

    af:showPopupBehavior mouseHover delay time

    966354
      Hi,

      I have a client requirement to cancel or make shorter delay between mouseHover event and showing popup to user. On page

      http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_showPopupBehavior.html

      I have found there is 500 ms delay but there is any information is there any way to customize it.

      Have anyone any idea is it really possible to make this delay shorter?

      Regards,

      Adam
        • 1. Re: af:showPopupBehavior mouseHover delay time
          Kamaal, Saif Kamaal
          One question here : IS the issue related to showing of the popup or the contents of the popup.

          Also can you try changing the content delivery of the popup.
          • 2. Re: af:showPopupBehavior mouseHover delay time
            966354
            This issue is related to whole popup, not its content.
            I have already tried to change contentDelivery attribute on popup component and it did not worked.

            Currently my popup has attribute "contentDelivery" set to "immediate".


            Regards
            • 3. Re: af:showPopupBehavior mouseHover delay time
              David Pérez Martín
              Hi

              To change the delay from 500ms to any other value, you should create a JS file and import it to the page as a <af:resource>

              Implement this function on your JS file and modify the 500 value as desired.
              AdfShowPopupBehavior.prototype.fire = function (a)
              {
                  a.cancel();
                  var b = AdfPage.PAGE, c = this._type, d = a.getSource(), e = d.getClientId(), f = d.findComponent(this._popupId);
                  if (AdfPage.PAGE.isScreenReaderMode() && (c == "mouseHover" || c == "mouseMove" || c == "mouseOver" || c == "mouseOut"))
                  AdfLogger.LOGGER.fine("showPopupBehavior trigger type " + c + " suppressed in screen reader mode for launch source id: " + e);
                  else if (f)
                  {
                      var g = f._delayedActivationState;
                      if (g)
                      if (g.launchSourceId == e)
                          return;
                      else 
                      b.cancelTimer(g.timerId), 
                      delete f._delayedActivationState;
                      if (f.isPopupVisible())
                      {
                          var h = this._getPopupWindow(f);
                          if (h == null)
                          return;
                          g = this._isInlinePopupSelector(h);
                          h = this._wasOpendedFromSameSource(h, e);
                          if (g)
                          {
                              if (f.hide(), h)
                                  return 
                          }
                          else 
                          h || f.hide()
                      }
                      var k = this._align, h = this._alignId, g = 
                      {
                      };
                      g[AdfRichPopup.HINT_LAUNCH_ID] = e;
                      var l = this._type == AdfComponentEvent.CONTEXT_MENU_EVENT_TYPE;
                      if (h || k || l)
                      {
                          k && (g[AdfRichPopup.HINT_ALIGN] = k, h || (h = d.getClientId(), k = h.lastIndexOf(":"), k !=  - 1 && (h = h.substring(k + 1))));
                          h && ((k = d.findComponent(h)) ? g[AdfRichPopup.HINT_ALIGN_ID] = k.getClientId() : AdfLogger.LOGGER.warning("Unable to find align component: ", h));
                          if (l)
                          g[AdfDhtmlPopupWindow.HINT_TYPE] = AdfDhtmlPopupWindow.HINT_TYPE_MENU, g[AdfDhtmlPopupWindow.HINT_AUTODISMISS] = AdfDhtmlPopupWindow.HINT_AUTODISMISS_MENU, h || (h = AdfAgent.AGENT.getMousePosition(a.getNativeEvent()), g[AdfDhtmlPopupWindow.HINT_MOUSEPOSITION] = h);
                          if (c == "mouseHover")
                          g[AdfDhtmlPopupWindow.HINT_AUTODISMISS] = AdfDhtmlPopupWindow.HINT_AUTODISMISS_MOUSEOUT, g[AdfDhtmlPopupWindow.HINT_AUTODISMISS_MOUSEOUT_ID] = g[AdfRichPopup.HINT_ALIGN_ID] ? g[AdfRichPopup.HINT_ALIGN_ID] : g[AdfRichPopup.HINT_LAUNCH_ID]
                      }
                      a.getType() == AdfUIInputEvent.MOUSE_IN_EVENT_TYPE ? (a = b.scheduleTimer(this, this._onMouseOverTimeout, 
                      {
                          hints : g, popup : f, source : d
                      },
              500), f._delayedActivationState = 
                      {
                          timerId : a, launchSourceId : e
                      },
                      d.addEventListener(AdfUIInputEvent.MOUSE_OUT_EVENT_TYPE, this._fireCancel, this)) : f.show(g)
                  }
                  else 
                  AdfLogger.LOGGER.severe("Could not find popup ", this._popupId, " from component ", d)
              };
              Regards