[From nobody Fri Oct 31 05:03:23 2008 X-Mozilla-Keys: Message-ID: <4901FA06.8090404@websynapsis.com> Date: Fri, 24 Oct 2008 18:38:30 +0200 From: Marco Lettere <m.lettere@websynapsis.com> User-Agent: Thunderbird 2.0.0.6 (X11/20070824) MIME-Version: 1.0 To: laszlo-user@openlaszlo.org Subject: [Laszlo-user] import makes assumptions on file names? References: <59B408DED89749579E60949F2FFBBA1A@visustt.com> In-Reply-To: <59B408DED89749579E60949F2FFBBA1A@visustt.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello all, I'm trying to dynamically load two different pieces of application that reside in very different directories but whose filename is the same (something like ../../dir1/dir2/standalone.lzx and ../../dir3/dir4/standalone.lzx). I do it in OL 4.2 (but 4.1 seems to behave the same way) by using the import tag (with stage="defer"). The two "import.load()" occur very close (in time) to each other and in particular might also overlap. So, it seems that OL gets confused actually it doesn't find one of the classes contained in the files to be instantiated. But if I change the name of one of the two files then everything seems to work. Am I right in the statement contained in the subject? Thank you all, M. The two imports for your documentation: <import name="mainmenuimport" href="../../../mainmenu/views/mainmenu/standalone.lzx" stage="defer"> <attribute name="area" type="string"/> <attribute name="classname" type="string"/> <handler name="onload"> //canvas.instantiate(this.classname, this.area) var constructor = eval(this.classname) if(constructor == null){ Debug.warn("Cannot instantiate undefined class "+classname); Debug.warn("Trying with 'lz.' ..."); constructor = eval('lz.'+this.classname) if(constructor == null){ Debug.warn("Cannot instantiate undefined class lz." + this.classname); return; } } new constructor(eval(this.area),{}) </handler> </import> <import name="testimport" href="../../../guicontroller/views/test/standalone.lzx" stage="defer"> <attribute name="area"/> <attribute name="classname" type="string"/> <handler name="onload"> //canvas.instantiate(this.classname, this.area) var constructor = eval(this.classname) if(constructor == null){ Debug.warn("Cannot instantiate undefined class "+classname); Debug.warn("Trying with 'lz.' ..."); constructor = eval('lz.'+this.classname) if(constructor == null){ Debug.warn("Cannot instantiate undefined class lz." + this.classname); return; } } new constructor(eval(this.area),{}) </handler> </import> ]