[Laszlo-dev] Semantics of "_instanceAttrs" have been changed?

André Bargull a.bargull at intensis.de
Fri Mar 21 13:46:49 PDT 2008


Apparently, it's less private for basetree and basegridcolumn. Both are 
using _instanceAttrs to create a clone of a view. Bad components!


On 3/21/2008 7:19 PM, P T Withington wrote:
> Construct should not be looking at _instanceAttrs.  That is a private 
> protocol with replication.  Construct should be looking at args.
>
> It seems like you want LzDataset to default its name to 
> 'localdataset'.  The way to do that in the new regime would be to say:
>
>   LzDataset.attributes.name = 'localdataset';
>
> This will cause the default name to be 'localdataset', but specifying 
> a name will override that.  And you don't have to play any magic in 
> construct.
>
> Then you could create an anonymous dataset by saying `new 
> LzDataset(<parent>, {name: null})`.
>
> On 2008-03-21, at 12:15 EDT, André Bargull wrote:
>> Bad news:
>> This application 
>> "http://labs.openlaszlo.org/trunk-nightly/docs/developers/programs/data_app-$9.lzx?debug=true&lzr=dhtml" 
>> does not work anymore in dhtml.
>> Good news:
>> It does work now in SWF with the recent changes, beforehand it didn't 
>> work either, but that's another story.
>>
>> What happens:
>> LzDataset#construct(..) checks the "_instanceAttrs" property for the 
>> name of the dataset:
>> ---
>>   if (this._instanceAttrs['name'] == null) {
>>       this._instanceAttrs['name'] = 'localdata';
>>   }
>> ---
>> AnonDatasetGenerator (in "LzParsedPath.lzs") creates a new dataset 
>> without any name:
>> ---
>> function getContext () {
>>   var d = new LzDataset();//no args -> _instanceAttrs is now undefined!
>>   var dp = d.getPointer();
>>   [...]
>> ---
>>
>> So, beforehand the dataset got the name "localdata" and it was placed 
>> on the canvas (which is wrong!) through the special dataset 
>> name-setter magic. Now there is no name, so the setter for that 
>> property isn't called and the application runs properly (in SWF).
>>
>> Right now I'm testing a fix for this issue.
>>
>
>


More information about the Laszlo-dev mailing list