force to refresh browser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jay

    #16
    Re: force to refresh browser

    I tried with test1 and test2.
    What I did was while I'm watching test1.htm.

    modify values in test2 and save.
    test1.htm.value s in text box is not changed.
    Unless I refresh test.htm.

    Could I force to refresh test1.htm from test2?
    Thanks alot.





    "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
    news:MPG.1a26a1 11a709003498999 8@nntp.lucent.c om...[color=blue]
    > In article <bpinhb$21vg$1@ msunews.cl.msu. edu>, no@spam.com enlightened
    > us with...[color=green]
    > > then Until test2 is fully updated user is not seeing test1?
    > >[/color]
    >
    > No, they see it.
    >
    > That's the point of the iframe.
    >
    > --
    > ~kaeli~
    > Murphy's Law #3020: Quality assurance doesn't.
    > http://www.ipwebdesign.net/wildAtHeart
    > http://www.ipwebdesign.net/kaelisSpace
    >[/color]


    Comment

    • kaeli

      #17
      Re: force to refresh browser

      In article <bpirep$25p8$1@ msunews.cl.msu. edu>, no@spam.com enlightened
      us with...[color=blue]
      > I tried with test1 and test2.
      > What I did was while I'm watching test1.htm.
      >
      > modify values in test2 and save.[/color]
      [color=blue]
      > test1.htm.value s in text box is not changed.
      > Unless I refresh test.htm.
      >
      > Could I force to refresh test1.htm from test2?[/color]

      Yes, but you're doing someting wrong if the write didn't show in test1.
      Test2 is dynamic in practice - the values are assumed to be gotten from
      XML or some other server-side language. The hardcoded values are for
      testing only, to show you it could be done. You'd need to refresh only
      if you changed hardcoded values (hardcoded values would defeat the
      entire purpose of this exercise). When you make it dynamic, you don't
      have to refresh.

      I don't use xml or I'd give you an example.
      I can give you an example with ASP or JSP...?

      --
      ~kaeli~
      You feel stuck with your debt if you can't budge it.



      Comment

      • Jay

        #18
        Re: force to refresh browser

        JSP would be great.
        Thanks.


        "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
        news:MPG.1a26b2 527913287a98999 9@nntp.lucent.c om...[color=blue]
        > In article <bpirep$25p8$1@ msunews.cl.msu. edu>, no@spam.com enlightened
        > us with...[color=green]
        > > I tried with test1 and test2.
        > > What I did was while I'm watching test1.htm.
        > >
        > > modify values in test2 and save.[/color]
        >[color=green]
        > > test1.htm.value s in text box is not changed.
        > > Unless I refresh test.htm.
        > >
        > > Could I force to refresh test1.htm from test2?[/color]
        >
        > Yes, but you're doing someting wrong if the write didn't show in test1.
        > Test2 is dynamic in practice - the values are assumed to be gotten from
        > XML or some other server-side language. The hardcoded values are for
        > testing only, to show you it could be done. You'd need to refresh only
        > if you changed hardcoded values (hardcoded values would defeat the
        > entire purpose of this exercise). When you make it dynamic, you don't
        > have to refresh.
        >
        > I don't use xml or I'd give you an example.
        > I can give you an example with ASP or JSP...?
        >
        > --
        > ~kaeli~
        > You feel stuck with your debt if you can't budge it.
        > http://www.ipwebdesign.net/wildAtHeart
        > http://www.ipwebdesign.net/kaelisSpace
        >[/color]


        Comment

        • kaeli

          #19
          Re: force to refresh browser

          In article <bpitf3$27ic$1@ msunews.cl.msu. edu>, no@spam.com enlightened
          us with...[color=blue]
          > JSP would be great.
          > Thanks.
          >[/color]

          Okay, this is tested successfully in NN6+ only.


          test1.jsp has a table with just a header.
          test2.jsp queries a DB, then writes the results to the table in
          test1.jsp.

          When the user brings up test1, they see only the table headers until the
          query from test2 is completed. When the query is done, the page loads
          and fills in test1's table.

          test1.jsp
          <html>
          <head>
          <title>Untitl ed Document</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          </head>

          <body>
          <p>This is a test page with an iframe that fills in the table below.</p>
          <table width="75%" border="1" cellspacing="1" cellpadding="5" >
          <tbody id="cTbl">
          <tr>
          <td width="10%" nowrap>Customer Id</td>
          <td width="90%" nowrap>Customer Name</td>
          </tr>
          </tbody>
          </table>
          <p>&nbsp;</p>
          <iframe height="1px" width="1px" src="test2.jsp" style="top:-
          50;position:abs olute;"></iframe>
          </body>
          </html>


          test2.jsp
          <%@ page import="OPS.*" %>
          <%@ page import="java.sq l.*" %>
          <html>
          <head>
          <title>Untitl ed Document</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          </head>

          <body>
          This is the contents of the iframe for test1.jsp
          <%
          String q;
          String userName="";
          String psswd="";
          ResultSet rs;
          int x = 0; // keep row count
          // connect to the database
          OPS_dbInteract opsConn = new OPS_dbInteract( );
          opsConn.connect ();
          q = "select unique customerName, UPPER(customerN ame) as CN, customerId
          " +
          "from customerTbl where customerName like 'A%' "+
          "order by CN";
          rs = opsConn.queryDB (q);
          // for each customer, fill table in test1.jsp
          while (rs != null && rs.next())
          {
          x++; //row count
          %>
          <script type="text/javascript">
          TR = document.create Element("TR");
          TD = document.create Element("TD");
          txt = document.create TextNode("<%= rs.getLong("cus tomerId") %>");
          TD.appendChild( txt);
          TR.appendChild( TD);
          TD = document.create Element("TD");
          txt = document.create TextNode("<%= rs.getString("c ustomerName")
          %>");
          TD.appendChild( txt);
          TR.appendChild( TD);
          top.document.ge tElementById("c Tbl").appendChi ld(TR);
          </script>
          <%
          }
          opsConn.close() ;
          %>

          </body>
          </html>




          --
          ~kaeli~
          Does the name Pavlov ring a bell?



          Comment

          • Jay

            #20
            Re: force to refresh browser

            Thanks, You are a life saver.
            I will let you know after testing.

            -kev

            "kaeli" <tiny_one@NOSPA M.comcast.net> wrote in message
            news:MPG.1a26e2 4fcdf7bab198999 a@nntp.lucent.c om...[color=blue]
            > In article <bpitf3$27ic$1@ msunews.cl.msu. edu>, no@spam.com enlightened
            > us with...[color=green]
            > > JSP would be great.
            > > Thanks.
            > >[/color]
            >
            > Okay, this is tested successfully in NN6+ only.
            >
            >
            > test1.jsp has a table with just a header.
            > test2.jsp queries a DB, then writes the results to the table in
            > test1.jsp.
            >
            > When the user brings up test1, they see only the table headers until the
            > query from test2 is completed. When the query is done, the page loads
            > and fills in test1's table.
            >
            > test1.jsp
            > <html>
            > <head>
            > <title>Untitl ed Document</title>
            > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            > </head>
            >
            > <body>
            > <p>This is a test page with an iframe that fills in the table below.</p>
            > <table width="75%" border="1" cellspacing="1" cellpadding="5" >
            > <tbody id="cTbl">
            > <tr>
            > <td width="10%" nowrap>Customer Id</td>
            > <td width="90%" nowrap>Customer Name</td>
            > </tr>
            > </tbody>
            > </table>
            > <p>&nbsp;</p>
            > <iframe height="1px" width="1px" src="test2.jsp" style="top:-
            > 50;position:abs olute;"></iframe>
            > </body>
            > </html>
            >
            >
            > test2.jsp
            > <%@ page import="OPS.*" %>
            > <%@ page import="java.sq l.*" %>
            > <html>
            > <head>
            > <title>Untitl ed Document</title>
            > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
            > </head>
            >
            > <body>
            > This is the contents of the iframe for test1.jsp
            > <%
            > String q;
            > String userName="";
            > String psswd="";
            > ResultSet rs;
            > int x = 0; // keep row count
            > // connect to the database
            > OPS_dbInteract opsConn = new OPS_dbInteract( );
            > opsConn.connect ();
            > q = "select unique customerName, UPPER(customerN ame) as CN, customerId
            > " +
            > "from customerTbl where customerName like 'A%' "+
            > "order by CN";
            > rs = opsConn.queryDB (q);
            > // for each customer, fill table in test1.jsp
            > while (rs != null && rs.next())
            > {
            > x++; //row count
            > %>
            > <script type="text/javascript">
            > TR = document.create Element("TR");
            > TD = document.create Element("TD");
            > txt = document.create TextNode("<%= rs.getLong("cus tomerId") %>");
            > TD.appendChild( txt);
            > TR.appendChild( TD);
            > TD = document.create Element("TD");
            > txt = document.create TextNode("<%= rs.getString("c ustomerName")
            > %>");
            > TD.appendChild( txt);
            > TR.appendChild( TD);
            > top.document.ge tElementById("c Tbl").appendChi ld(TR);
            > </script>
            > <%
            > }
            > opsConn.close() ;
            > %>
            >
            > </body>
            > </html>
            >
            >
            >
            >
            > --
            > ~kaeli~
            > Does the name Pavlov ring a bell?
            > http://www.ipwebdesign.net/wildAtHeart
            > http://www.ipwebdesign.net/kaelisSpace
            >[/color]


            Comment

            Working...