I wrote the code that used this quite a bit ago so I dont remember all the
details but basically the use case is as such:
I have an object A and an object B. One of A property is bound to B, but
needs to be converted. The conversion depends on one of the property of the
B object. For instance, a boolean may be true or false, and this would
affect the way the property is converted.
In such an use case it was useful to get the targetObject sent to the
conversion function.
On Thu, Nov 4, 2010 at 3:34 PM, Martin Wittemann
<[email protected]>wrote:
> Hey,
>
> > This mail is for Martin.
> Seems to be sure who's the man in charge here. ;)
>
> > I would like to suggest a small change in SingleValueBinding.js. In
> __convertValue, a second argument is sent to the converter function if the
> targetObject has a getModel() function. But I found myself in a situation
> where I needed to have the targetObject itself sent as a value to the
> convert function (that can be useful).
> Could you maybe describe that situation? Maybe there is already another way
> of getting that done.
>
> > So I changed the code from
> >
> > if (targetObject.getModel) {
> > model = targetObject.getModel();
> > }
> >
> > to
> >
> > if (targetObject.getModel) {
> > model = targetObject.getModel();
> > }
> > else
> > {
> > model = targetObject;
> > }
> >
> > This works fine and achieved exactly what I needed. I would like this
> patch to get applied upstream, so that one can always have the targetObject
> sent to the converter function (or its model, in the case the targetObject
> has a model).
> >
> > Martin, are you OK with that?
> Depending on the use case. ;) I don't get exactly the reason why it should
> be necessary.
> What i would not do is to use the second parameter if no model is
> available. Why not use the third one and give it a specific meaning in every
> case?
>
> Regards,
> Martin
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel