2 Replies Latest reply on May 28, 2012 10:44 AM by true_mykola

    "this" in oncomplete of a4j:commandButton

    true_mykola

      In RF3 this always returned button when using in oncomplete of a4j:commandButton, now, in RF4, for some reason it's window. Is there any way to get old behaviour back?

        • 1. Re: "this" in oncomplete of a4j:commandButton
          mcmurdosound

          just use the "event" javascript object. There's the source attribute which gives you the original input element. On different browsers there might be some other attribute like target, currentTarget etc.

           

          Try'em out!

           

          (And I don't think the issue should be "major" --- more like a feature request)

          • 2. Re: "this" in oncomplete of a4j:commandButton
            true_mykola

            Well, it really works although a little bit strange because in FF source element should be event.target and it is RF3, but here it's event.source. But even though it works i think it should stay as bug (not feature request), as when i use inside some element this i expect current element and not window.