-
Notifications
You must be signed in to change notification settings - Fork 214
Montage ♥ FRB
mczepiel edited this page Feb 27, 2013
·
20 revisions
Before
myObject.addPropertyChangeListener("path", handler)
When the path changes myObject.handleChange(notification)
will be called
After
myObject.addPathChangeListener("path", handler)
When the path changes the handler function is called using the following strategy:
When handler
is a:
- function: function is called
-
object:
myObject.handlePathChange
is called - methodName: ```myObject[methodName] is called
and is passed the newValue
, affectedPath
, sourceObject
Before
myObject.addPropertyChangeListener("path", handler, true)
After
myObject.addPathChangeListener("path", handler, "handleMethodName", true)
How do I bind a property of my object to a property of another object such that they are always the same?
Before
Object.defineBinding(myObject, "myProperty", {
boundObject: anotherObject,
boundObjectPropertyPath: "foo.bar"
});
After
myObject.defineBinding("myProperty", {"<->": "foo.bar", source: anotherObject});
How do I bind a property of my object to a property of another object such that changes to myProperty do not affect the otherObject's property?
Before
Object.defineBinding(myObject, "myProperty", {
boundObject: anotherObject,
boundObjectPropertyPath: "foo.bar",
oneway: true
});
After
myObject.defineBinding("myProperty", {"<-": "foo.bar", source: anotherObject});