From 9b8a24a7360416d5750828c9580e33dd336ff882 Mon Sep 17 00:00:00 2001 From: François Frisch Date: Fri, 16 Mar 2012 17:57:18 -0700 Subject: Getting ownerComponent bindings --- node_modules/montage/ui/text-input.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'node_modules/montage/ui/text-input.js') diff --git a/node_modules/montage/ui/text-input.js b/node_modules/montage/ui/text-input.js index cdd20c78..d707fa69 100644 --- a/node_modules/montage/ui/text-input.js +++ b/node_modules/montage/ui/text-input.js @@ -79,6 +79,28 @@ var TextInput = exports.TextInput = Montage.create(NativeControl, { } }, + _valueBinding: { + value: null + }, + + valueBinding: { + get: function() { + return this._valueBinding; + }, + set: function(value) { + if (this._valueBinding !== value) { + if (this._valueBinding !== null) { + Object.deleteBinding(this, "value"); + } + this._valueBinding = value; + if (String.isString(value)) { + Object.defineBinding(this, "value", {boundObject: this.ownerComponent, boundObjectPropertyPath: value}); + + } + } + } + }, + // set value from user input /** @private -- cgit v1.2.3