Hi Martin,

This time I think I got everything, thanks! More detailed explanations below


If you want to use the MEventBubbling mixin you have to call that method on
> every change. The way i did it in the generated classes is to use this
> method (__applyEventPropagation) as apply on every property, which you can
> add easily with the apply key in the property definition. If you already
> have an apply method, just call the method in your apply and you should be
> fine. The advantage of using he bubbling is that the events will bubble up
> the object hierarchy. Thats an huge advantage to implementing the actual
> function code in the objects.
>

I see. Looks perfectly doable.



> Last question, I am interested in the hierarchy data binding ("A more
>> advanced feature of the single value binding is to bind a hierarchy of
>> properties to a target property.")
>>
>> However, conceptually, with a complex model, there could be more than one
>> child for the parent object.
>> Eg, how would you adapt the current following code to a case where a has a
>> "b" node but also a "c" node with a different property? Does not look
>> possible currently...
>>
>> var a = new Node("a");      // set the name to „a“
>> var b = new Node("a");      // set the name to „b“
>> a.setChild(b);
>>
>>
>> // bind the property to a labels content
>> a.bind("child.name", label, "content");
>>
>>
>>
>> The binding always goes down from one property to another. If you change
>> something in the chain, the binding tries to get down the new property
>> chain. If thats not possible, the target property will be reseted.
>> I did recently a presentation on the whole data binding layer. Perhaps the
>> slides could make the concept of the "deep binding" better understandable.
>> You can find the slides on my slideshare account.
>> http://www.slideshare.net/wittemann/data-binding-in-qooxdoo
>>
>
> For this I think you did not really understand my question. Let's imagine
> that we have an object myZoo of the class Zoo. Zoo has two properties lion,
> and elephant.
>
>
> You are right, but now i get your question. ;)
>
>
> How could I bind myZoo.lion.age to a GUI widget (like a slider), but at the
> same time bind myZoo.elephant.age to another slider widget?
>
> If I do myZoo.setChild(lion); then I guess it has no sense writing
> myZoo.setChild(elephant) because I already declared a child - but myZoo in
> effect has multiple children!
>
> In the
>
> myZoo.bind("child.age <http://child.name/>", slider, "value");
>
> call, which child will be used?
>
>
> Your example itself is some kind of misleading. If you have a myZoo object
> which does have two properties (lion and elephant) you will have to use this
> properties to set the objects. So myZoo.setChild adresses a third property
> called child. If you want to set the lion property, you have to use
> myZoo.setLion(lion) and the same for the elephant:
> myZoo.setElephant(elephant).
> That way, you have two properties set to two different objects. This could
> be used in the binding as well:
>
> myZoo.bind("lion.age", slider1, "value);
> myZoo.bind("elephant.age", slider2, "value");
>
> If you want to use only one property and swith the animals on runtime, you
> can du that with the mentioned child property (or call is something else, it
> doesn't matter).
>
> myZoo.bind("child.age", slider, "value");
>
> myZoo.setChild(lino);               // lions age is bound to the slider
> myZoo.setChild(elephant);      // elephants age is bound to the slider
>
> So it depends on what you want to achieve.
>

Actually I did not understand this problem, only because I did not realize
"child" was a standard property (that could be named something else). I
somehow thought the child property was a special one that would be used just
for this deep binding purpose, and you could have thus only one single deep
binding. Now you made clear that "child' was just an example and it would
work perfectly with another property name, so all my confusion is gone.
Sorry I did not catch that at the beginning.

Thanks again!
Cheers
Jean-Noel
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to