reloading windows

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

    reloading windows

    I am constructing a company intranet.
    On the intranet I made an overview-page which displays the availability of
    equipment.
    The information comes out of a database, and is retrieved by php-script.
    The users of the database should be able to change the status of the
    equipment.
    On the overview-page, I placed a button next to each piece of equipment.
    On pressing the button, a new window is opened, in which the user can input
    the changes.
    On this new window, a "submit"-button and a "cancel"-button can be pressed.
    On pressing the submit-button, a php-script is called to make the changes in
    the database, on "cancel", the new window is closed.
    After pressing the submit-button, I want the initial overview-page to be
    reloaded (refreshed) with the new information.

    Can anyone help me?

    I already tried this, but nothing happens:

    The overview-page contains the following script:

    <script language="JavaS cript" type="text/JavaScript">
    window.name = "materieeloverz icht"
    </script>

    The php page contains the following script:

    <script language="JavaS cript" type="text/JavaScript">
    materieeloverzi cht.location.re load()
    </script>


  • asdf asdf

    #2
    Re: reloading windows

    If you have the luxury of supporting only Internet Explorer, have a
    look at window.showModa lDialog:

    Gain technical skills through documentation and training, earn certifications and connect with the community

    reference/methods/showmodaldialog .asp

    There is probably a more elegant solution based on window/frame/form
    naming.

    Hope that helps,
    Ron

    Comment

    • Greg

      #3
      Re: reloading windows

      "Sam" <samvandevelde@ tiscali.be> wrote in message news:<y_d9b.213 74$Kn2.1114214@ phobos.telenet-ops.be>...[color=blue]
      > I am constructing a company intranet.
      > On the intranet I made an overview-page which displays the availability of
      > equipment.
      > The information comes out of a database, and is retrieved by php-script.
      > The users of the database should be able to change the status of the
      > equipment.
      > On the overview-page, I placed a button next to each piece of equipment.
      > On pressing the button, a new window is opened, in which the user can input
      > the changes.
      > On this new window, a "submit"-button and a "cancel"-button can be pressed.
      > On pressing the submit-button, a php-script is called to make the changes in
      > the database, on "cancel", the new window is closed.
      > After pressing the submit-button, I want the initial overview-page to be
      > reloaded (refreshed) with the new information.
      >
      > Can anyone help me?
      >
      > I already tried this, but nothing happens:
      >
      > The overview-page contains the following script:
      >
      > <script language="JavaS cript" type="text/JavaScript">
      > window.name = "materieeloverz icht"
      > </script>
      >
      > The php page contains the following script:
      >
      > <script language="JavaS cript" type="text/JavaScript">
      > materieeloverzi cht.location.re load()
      > </script>[/color]

      materieeloverzi cht looks to be a string not a window reference. You
      have a perfectly good reference to the parent window in the child
      window opener property, but it seems that you can use the window name
      if you call window.open() with the name argument

      // a.htm (parent)
      <script type='text/javascript'>
      window.name = 'bill';
      function openB(){
      window.open('b. htm');
      }
      window.onload = function (){
      window.status = new Date(); // load indicator
      window.setTimeo ut('window.stat us = window.defaultS tatus', 2000);
      }
      </script>
      <a href='#a1' name='a1' id='a1' onclick='openB( ); return false;'>Open
      b.htm</a>


      // b.htm (child)
      <script type='text/javascript'>
      function reloadA(){
      window.open('a. htm', 'bill',);
      }
      </script>
      <a href='#a1' name='a1' id='a1' onclick='reload A(); return
      false;'>Reload a.htm</a>

      Not an expert. FWIW.

      Comment

      • DU

        #4
        Re: reloading windows

        Sam wrote:
        [color=blue]
        > I am constructing a company intranet.
        > On the intranet I made an overview-page which displays the availability of
        > equipment.
        > The information comes out of a database, and is retrieved by php-script.
        > The users of the database should be able to change the status of the
        > equipment.
        > On the overview-page, I placed a button next to each piece of equipment.
        > On pressing the button, a new window is opened, in which the user can input
        > the changes.
        > On this new window, a "submit"-button and a "cancel"-button can be pressed.
        > On pressing the submit-button, a php-script is called to make the changes in
        > the database, on "cancel", the new window is closed.
        > After pressing the submit-button, I want the initial overview-page to be
        > reloaded (refreshed) with the new information.
        >
        > Can anyone help me?
        >
        > I already tried this, but nothing happens:
        >
        > The overview-page contains the following script:
        >
        > <script language="JavaS cript" type="text/JavaScript">
        > window.name = "materieeloverz icht"
        > </script>
        >[/color]

        The window.name is just a string for the target. The window name does
        not do much really except in js disabled contexts.
        [color=blue]
        > The php page contains the following script:
        >
        > <script language="JavaS cript" type="text/JavaScript">
        > materieeloverzi cht.location.re load()
        > </script>[/color]

        You need here a window object reference (not a window name) and you need
        to set the reload to true so that a refresh (unconditional get) at the
        server is mandatory.

        Let's say you did:

        <script type="text/css">
        var WindowObjectRef erence = null; // must be global scope
        function OpenWindowEquip mentAvailabilit y()
        {
        if(WindowObject Reference == null || WindowObjectRef erence.closed)
        {
        WindowObjectRef erence = window.open(str Url, strWindowName,
        strWindowFeatur esList);
        };
        }
        </script>

        then later you can reload that window with changes thanks to

        <script type="text/javascript">
        WindowObjectRef erence.location .reload(true);
        </script>
        You could even combine both script content into 1 single one.

        To close after a click of the cancel button, you would call in this order:
        WindowObjectRef erence.close();
        WindowObjectRef erence = null;

        DU
        --
        Javascript and Browser bugs:

        - Resources, help and tips for Netscape 7.x users and Composer
        - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


        Comment

        Working...