[Laszlo-user] When is 'isinit' set?
P T Withington
ptw at openlaszlo.org
Thu Jul 12 03:51:14 PDT 2007
You may find this helpful:
http://www.openlaszlo.org/lps4/docs/guide/initialization-and-
instantiation.html#d0e35430
Note that in 4.x, handlers on the instance being constructed that
would be triggered due to setting initial values into the instance
are deferred until _all_ the initial values are set -- so the
handlers will not see a partially constructed instance.
On 2007-07-12, at 06:23 EDT, ason wrote:
> I think that is normal.
>
> The sequence is:
> 1. onconstruct
> 2. isinited=true
> 3. oninit
>
> <canvas debug="true">
> <view>
> <handler name="onconstruct">
> if( $debug) Debug.write("onconstruct
> isinited=",isinited);
> </handler>
> <handler name="oninit">
> if( $debug) Debug.write("oninit isinited=",isinited);
> </handler>
> </view>
> </canvas>
>
>
>
> --- Robin Sheat <robin at kallisti.net.nz> wrote:
>
>> I have a class with attributes that are set via
>> databinding, and some handlers
>> listening to those attributes inside the class.
>> However, I don't want the
>> handlers to do anything if this is the initial setup
>> of the class (just if
>> something changes later on). I thought I could use
>> 'isinited' to test for
>> this, however it seems to be getting set to true
>> earlier than I would have
>> though.
>>
>> My handler is being called before my oninit handler
>> (due to the initial
>> binding), however I have this:
>> if (!this.isinited) {
>> return;
>> }
>> at the start of the handler. The problem is,
>> this.isinited==true even before
>> oninit runs. Is this normal?
>>
>> --
>> Robin <robin at kallisti.net.nz> JabberID:
>> <eythian at jabber.kallisti.net.nz>
>>
>> Hostes alienigeni me abduxerunt. Qui annus est?
>>
>> PGP Key 0xA99CEB6D = 5957 6D23 8B16 EFAB FEF8 7175
>> 14D3 6485 A99C EB6D
>>
>
>
>
>
> ______________________________________________________________________
> ______________
> Got a little couch potato?
> Check out fun summer activities for kids.
> http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities
> +for+kids&cs=bz
More information about the Laszlo-user
mailing list