2 Replies Latest reply on Aug 24, 2008 1:29 AM by lee64

    <a4j:jsFunction>question

    lee64

      Hello,
      I have this code:

      <a4j:form>
      <a4j:jsFunction id="disSession" action="#{user.logoutAction}"/>
      </a4j:form>

      How to invoke when event "window.onunload" occors?

        • 1. Re: <a4j:jsFunction>question

          First of, you need to define a name attribute. You cannot invoke function if it has no name.

          Then you can invoke jsFunction as any other javascript function on the page by its name.

          <body onload="foo()">
          ....
          <a4j:form>
          <a4j:jsFunction id="disSession" name="foo" action="#{user.logoutAction}"/>
          </a4j:form>


          • 2. Re: <a4j:jsFunction>question
            lee64

            thanks a lot! It works.
            When close a IE tab(onunload JS event) invoke the logoutAction of Mbean.