Also, I have modified the loadpanel.js to invoke a beforeload event, which I use to check if a loadpanel is in the middle of loading.  Another change that I made was to put a variable in the body of all the documents I load into a loadpanel (using <script> defer var loadvar='page1' </script> as the first line in the body).  I then put a loop in loadpanel.js that checks for this variable.  Once it finds the variable the loading is completed and the onload event is triggered.
 
Cheers
 
Chris
-----Original Message-----
From: Cameron Hart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 19 April 2001 12:25 AM
To: [EMAIL PROTECTED]
Subject: RE: [Dynapi-Help] LoadPanel Problem...

also, i noticed with my quick fix that I just made to loadpanel, the following works, i've just changed the order of how things are created a little bit. This would suggest that perhaps the loadpanel is trying to resize or reload before it's actually been created...
 
<html>
    <head>
        <title>DynAPI Distribution: LoadPanel Example modified</title>
        <script language="Javascript" src="../src/dynapi.js"></script>
        <script language="Javascript">
            DynAPI.setLibraryPath('../src/lib/');
            DynAPI.include('dynapi.api.*');
            DynAPI.include('dynapi.event.*')
            DynAPI.include('dynapi.gui.loadpanel.js');
        </script>
        <script language="Javascript">
            DynAPI. {
            lp = new LoadPanel();
             lp.setSize(250,50,false);
             lp.moveTo(50,100,false);
             lp.setBgColor('#ffff00');
             lp.setURL('dynapi.gui.loadpanel-file1.html');
             DynAPI.document.addChild(lp);
            lp2 = new LoadPanel();
             lp2.setSize(250,50,false);
             lp2.moveTo(300,100,false);
             lp2.setBgColor('#ff0000');
             lp2.setURL('dynapi.gui.loadpanel-file1.html');
             DynAPI.document.addChild(lp2);
            }
        </script>
    </head>
    <body>
    </body>
</html>
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Nicolas MASSART
Sent: 18 April 2001 13:13
To: [EMAIL PROTECTED]
Subject: Re: [Dynapi-Help] LoadPanel Problem...

The problem looks to be more dificult...
Infact, the real bug is that Loadpanel can't check if a file is completely loaded or not.(I speack only about NS4 wich uses the 'src' property of the layer to load the html content).
So if you have to LoadPanels loading at the same time (only a few miliseconds of delay), The first Loadpanel loads correctly but the second do not load. If you insert a break (an alert('hello'); for example) between the two loadpanels creation, the files are able to load completely and so you don't have any problems.
Do anynody see a workaround or any ways to patch the loadpanel ?
Thanks.
See example code bellow (test it on NS4, any plateform)

<html>
    <head>
        <title>DynAPI Distribution: LoadPanel Example modified</title>
        <script language="Javascript" src="../src/dynapi.js"></script>
        <script language="Javascript">
            DynAPI.setLibraryPath('../src/lib/');
            DynAPI.include('dynapi.api.*');
            DynAPI.include('dynapi.event.*')
            DynAPI.include('dynapi.gui.loadpanel.js');
        </script>
        <script language="Javascript">
            DynAPI. {
            //******* the first loadpanel ***************
             lp = new LoadPanel('dynapi.gui.loadpanel-file1.html');
             lp.setSize(250,50);
             lp.moveTo(50,100);
             lp.setBgColor('yellow');
             DynAPI.document.addChild(lp);
            //******* the second loadpanel ***************
             lp2 = new LoadPanel('dynapi.gui.loadpanel-file1.html');
             lp2.setSize(250,50);
             lp2.moveTo(300,100);
             lp2.setBgColor('red');
             DynAPI.document.addChild(lp2);
            }
            //-->
        </script>
    </head>
    <body>
    </body>
</html>
 

Reply via email to