[OpenAjaxIDE] Gadgets TF requests restoration of onchangePattern

Bertrand Le Roy Bertrand.Le.Roy at microsoft.com
Thu Aug 21 17:12:16 PDT 2008


So how about the default (and only) pattern is using a unique function? If your internal implementation is using onFooChanged patterns, you’d implement it like so:

MyWidget.prototype.propertyChangeCallback = function(propertyName, value) {
                this[“on” + propertyName + “Changed”](value);
}

This half-pattern that’s being proposed seems to offer not enough functionality at the price of some complexity that may not be necessary.

From: Jon Ferraiolo [mailto:jferrai at us.ibm.com]
Sent: Thursday, August 21, 2008 5:05 PM
To: Bertrand Le Roy
Cc: ide at openajax.org
Subject: RE: [OpenAjaxIDE] Gadgets TF requests restoration of onchangePattern


> So what’s the argument for having the pattern at all? (other than
> it’s already implemented)

I'm not sure what all of the arguments are, but here are ones that I remember from today's phone call.

Here is a weak argument: because the widget author prefers to name his callbacks in a different way

A stronger argument is that some developers will want to offer a single callback function to cover all properties, such as propertyChangeCallback(), especially if his widget has many similar properties. Then he could say:

<properties onchangePattern-"propertyChangeCallback">
<property name="prop1" .../>
<property name="prop2" .../>
etc.
</properties>

Jon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20080821/3f44f7be/attachment.html 


More information about the IDE mailing list