Actually, I think this may be part of your problem
> <method name="init" event="oninit">
This will get called twice -- once because it's an override of the view's
init method, and once because it responds to the view's oninit event.
A
On Jun 2, St??phane . wrote:
> Hi there, I've been gone in the wrong way for a little while when I
> understood how to instantiate visible components at runtime, and how to link
> them to attributs of classes.
>
> Read the following:
> here aLoginSession extends view
> <canvas>
> <attribute name="_LoginSession" />
> <view name="_view"
> width="100%"
> options="releasetolayout"
> bgcolor="olive"
> >
> <aLoginSession name="_LoginSession" />
> </view>
> <method name="init" event="oninit">
> this._LoginSession = this._view._LoginSession;
> </method>
> Then to hide it, simply this._LoginSession.setAttribute("visible", false);
>
> I write this post because firstly I 've gone another way:
> <canvas>
> <attribute name="_LoginSession">
> <view name="_view"
> width="100%"
> options="releasetolayout"
> bgcolor="olive"
> />
> <method name="init" event="oninit">
> this._LoginSession = new aLoginSession( this._view, {someAttrib:
> Somevalue});
> </method>
>
> This has been tortured me for a while because init is called twice... :)
>
> Some things to go further:
> here aSession extends view
> <canvas>
> <attribute name="_Sessions"/>
> <method name="init" event="oninit">
> this._Sessions = [aSession];
> </method>
> <method name="doCreateSession" args="somearg">
> newID = this._Sessions.length;
> this._Sessions[newID] = new aSession( this._view, {somattrib: somearg});
> </method>
> <method name="doShowSession" args="sessionid">
> this._Sessions[sessionid].showme();
> </method>
>
> Hope this will help.
> _______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user