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>
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"
/>
width="100%"
options="releasetolayout"
bgcolor="olive"
/>
<method name="init" event="oninit">
this._LoginSession = new aLoginSession( this._view, {someAttrib: Somevalue});
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
