On 2006-05-15, at 15:43 EDT, Stéphane . wrote:
> Here's code:
> <class name="aWindow" extends="view">
> <view>
> <somestuffhere/>
> </view>
> <otherstuffhere/>
> </class>
>
> In JS, how can I access the first view ? Shall I have to give it a
> name attribute or id ?
> The problem though is when instanciating many instances of the same
> class.
You can't give it an ID because those must be unique, which would not
work for many instances, but name will work fine:
<canvas>
<class name="aWindow" extends="view">
<view name="aView">
<somestuffhere/>
</view>
<otherstuffhere/>
</class>
<aWindow id="first" />
<aWindow id="second" />
<script>
Debug.format("The first window's view is %w", first.aView);
Debug.format("The second window's view is %w", second.aView);
</script>
</canvas>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user