Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with page refresh

    Hi,

    I have page with two frames. In one frame i am displaying list of records in the top frame. On clicking on the record in the top frame the details of the record is displayed in the bottom frame where the user can edit the fields. once the user modifies the values in the bottom frame the changed values should be reflected in the top frame. so iam reloading the page in the top frame after submit the bottom frame. Here before the data is modified in the database the top frame is retrieving the data from the database and displaying . hence again the old data is getting displayed. so what i want is to delay the top frame for some time probably for 2 seconds so that the data gets submitted in the databse. can any one tell how can i do it or what is the better way to do it.

    phani.
    phani

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    put this code in the action page where the details page (in bottom frame) gets submitted

    <%
    'server-side code that updates record
    %>
    <html>
    <head>
    <script>
    function reloadTop() {
    top.frames['nameOfTopFrameHere'].location.reload();
    }
    </script>
    </head>
    <body onload="reloadTop()">
    The record has been updated successfully.
    </body>
    </html>

  • #3
    New Coder
    Join Date
    Aug 2002
    Location
    india
    Posts
    74
    Thanks
    0
    Thanked 0 Times in 0 Posts
    what i need is to set some delay before reloading the top frame.

    i don't need to reload the topframe on every load of the page in the bottom page. here is the code i am using in the bottom frame where i am modifiying the data.


    document.forms[0].submit();
    parent.frames[1].location.reload();
    phani

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    The problem with that is you won't know how long the details page is processed.
    What page is displayed after the details page is updated? The same page with the updated data?
    If yes, you can just call the reloadTop() function ONLY if the details page is submitted from a POST method.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •