8 Replies Latest reply on Dec 18, 2007 5:09 AM by sankar_mariappan

    JSFunction

    sankar_mariappan

      Hi,
      How do i access Java Script function using JSF Managed Bean.

      I have Java Script source file separately., Now i want to access these Java Script file when session expired.. How can i access the java script file using JSF Managed Bean..

      Please reply fast its very urgent for us..

      Thanks & Regards,
      Sankar

        • 1. Re: JSFunction

          Hi,

          when you wanna access a client method from server side: this is not possible at all. Whenever you want a response from server there must be a request from client side first. Forget a 'server side request'.

          The solution for you: polling. Use direct javascript polling (setInterval) with an AJAX call, or a4j:poll/a4j:push.

          • 2. Re: JSFunction
            sankar_mariappan

            Hi,
            Thank you very much for your response..

            I have a problem, i want navigate automatically when user auto logoff of the system...

            Any way to navigate automatically when user auto logoff in JSF ?

            Thanks & Regards,
            Sankar.

            • 3. Re: JSFunction

              Doesn't it work the 'normal way' - by defining some rules in navigation config. For example in mine I have:

              <navigation-rule>
               <from-view-id>/restricted/modalPanels/quitpanel.xhtml</from-view-id>
               <navigation-case>
               <from-outcome>logout</from-outcome>
               <to-view-id>/login.xhtml</to-view-id>
               <redirect/>
               </navigation-case>
               </navigation-rule>


              Okay, that is obviously not automatically, but I guess, something like this will work also for auto log off. Did you try that? (You have to set from-view-id to the page the auto log off goes from)

              • 4. Re: JSFunction
                sankar_mariappan

                Hi, this works when firing a link or any., But i wanna navigate automatically to other page when auto logoff of a user session...

                Please tell me any way to implement....

                I am using 4 Frame inside of our Application Main page so i am not having knowledge to implement the auto logoff. Otherwise we can use Filter.

                I tried but its not working properly reason why when auto logoff it will show the session expired page in same window in another frame.

                This is my problem to implement the autologoff...

                • 5. Re: JSFunction
                  cameronr

                  This might help. http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/ArchitectureOverview.html#RequestErrorsAndSessionExpirationHandling

                  In particular the onExpired() method. You could handle this in a frame and use javascript to go up to the parent document and display a logout message, or navigate to some different page.

                  Cheers
                  Cameron

                  • 6. Re: JSFunction
                    cameronr

                    Oh - forgot to mention onExpired() will be called next time the user performs any ajax request. It won't 'automatically' be called without any user interaction but it is about as close as you can get.

                    • 7. Re: JSFunction
                      sankar_mariappan

                      Hi,
                      There is no function name in javascript and which attribute to call the onExpired() method

                      • 8. Re: JSFunction
                        sankar_mariappan

                        This is great idea.,

                        Thank you very much for ur response

                        Can you tell me how to use onExpired() .

                        I am have no knowledge on this..

                        I am trying to auto logoff and this is very important issue for me...

                        thanks a lot.....