Toufeeq,

I'm not sure why you would want to dynamically read a library to display
instances of a window.  You said that
you will pull this information at runtime, then why not just use datasets.

Here is an example based on the one above:

Running example - http://tiny.rlogin.org:8080/lps/window-binding/windows.lzx

Code

<canvas width="800" height="800">
    <dataset name="wdset">
        <window x="50" y="50">Window 1</window>
        <window x="100" y="100">Window 2</window>
        <window x="150" y="150">Window 3</window>
        <window x="200" y="200">Window 4</window>
        <window x="250" y="250">Window 5</window>
    </dataset>
    <window width="400" height="300" datapath="wdset:/window">
        <attribute name="x" value="$path{'@x'}" />
        <attribute name="y" value="$path{'@y'}" />

        <text datapath="$path{'text()'}" />
    </window>
</canvas>

HTH,

Anthony Bargnesi


On Feb 12, 2008 10:04 AM, Toufeeq Hussain <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I\'m trying to create child-windows within a Main window. the number
> of child windows is not known and that information is obtained via a
> remote datastore.
>
> The approach I\'m taking here is that each child-window is present as
> a library and trying to dynamically import these libraries based on
> the datastore-information obtained.
>
> I tried the example mentioned here :
> http://forum.openlaszlo.org/showthread.php?t=9713 but could not get it
> to work.
>
> My code is pretty similar to the one mentioned above:
>
> <canvas debug=\"true\">
>    <window width=\"400\" height=\"300\">
>        <handler name=\"oninit\">
>            var lib = new LzLibrary(canvas, {name:\"mylib\",
> stage:\"defer\"});
>            lib.href = \"child.lzx\";
>            new LzDelegate( {\"func\":function() {new child_window();
> }}, \"func\", lib, \"onload\");
>            lib.load();
>        </handler>
>    </window>
> </canvas>
>
> My child.lzx code is as follows:
>
> <library>
>    <class name=\"child_window\" extends=\"window\" height=\"30\"
> width=\"40\">
>        <text>BLAH</text>
>    </class>
> </library>
>
> At this point I\'m expecting to see a child-window in the main window
> with a text element in it. But nothing comes up. The main window loads
> but there is no child window.
>
> My question(s) is:
> Is the above approach correct ?
> if not, Is there a better approach ?
> What am I missing in the above code ?
>
> I do get a few WARNING\'s but googling* around I found that they are
> not a major concern.
>
> * http://forum.openlaszlo.org/archive/index.php/t-11198.html
>
> regards,
> Toufeeq
> --
> blog @ http://www.toufeeq.net
>

Reply via email to