[Laszlo-dev] Semantics of "_instanceAttrs" have been changed?
André Bargull
a.bargull at intensis.de
Fri Mar 21 15:00:02 PDT 2008
Maybe that would fit for basetree, but basegridcolumn is a bit more
complicated I guess:
- in its determinePlacement-method, it's taking the _instanceAttrs of
every subview with a placement of "content" or stores it together with
that view's tagname in its _contentsPackage-Array (and finally it
destroys the original subview)
- these informations are needed for _getCellForColumn, to build at a
later time a 'clone' (some sort of...)
- that's quite funny, isn't it?
On 3/21/2008 10:06 PM, P T Withington wrote:
> Grumble. Perhaps we should have a LzNode.clone() operator that hides
> this mechanism (and makes cloning generally available).
>
> On 2008-03-21, at 16:46 EDT, André Bargull wrote:
>> 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