refreshing parent window after closing child window

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vinutha
    New Member
    • Nov 2006
    • 19

    refreshing parent window after closing child window

    Hi,

    I am using javascript to close my child window and after closing child window, i want to refresh parent window.

    So, this is the script function i am using,

    Code:
    <script language="JavaScript">
    function closeAndRefresh()
    {
    window.opener.location.href="#{facesContext.externalContext.requestContextPath}/main/billing/billRecords.jsf";
                self.close();
    }
    </script>
    This is the commandbutton code i am using,

    <h:commandButto n value="OK" onclick="closeA ndRefresh()" />

    So, How to resolve this......

    Thanks,
    Vinutha
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    So what exactly is the problem?

    Comment

    • Vinutha
      New Member
      • Nov 2006
      • 19

      #3
      Originally posted by acoder
      So what exactly is the problem?

      I want to refresh parent window after closing child window.

      Thanks,
      Vinutha

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by Vinutha
        I want to refresh parent window after closing child window.

        Thanks,
        Vinutha
        What you could do is run a function on the parent page which refreshes after a few seconds or even one second using setTimeout, then close the child window. Perhaps you could check that the child window is indeed closed before refreshing the parent window.

        Comment

        Working...