I've just updated LoadPanel in CVS to fix this problem. If you check the Javascript console in NS4 you will see that there was an error being generated which was causing the problem.
 
Damn, just checked again and it's still not working consistently. Back to the drawing board...
 
The problem I think is to do with layers being recycled by the DynAPI for Netscape 4. Pre DynAPI 2.5 layers were not recycled when using removeFromParent, but now they are. If you have a chance, check your sample code out with DynAPI 2 and see if it works any better (and let us know).
 
Cheers,
 
Cameron.
-----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