Hi -
I'm binding two AutoCompleteModified objects to one another; meaning you type in one and it selects the correct object in the other. It works fine when I define it in MXML:
However, a user can add a new row to a Grid and then I set up the binding and objects via actionscript and it gives an 'undefined' error: ChangeWatcher line 427/wrapHandler.
var innerHBox:HBox = new HBox();
var dtc_acm:AutoCompleteModified = new AutoCompleteModified(); dtc_acm.dataProvider = data2; dtc_acm.labelField = 'id';
var cp_acm:AutoCompleteModified = new AutoCompleteModified(); cp_acm.dataProvider = data2; cp_acm.labelField = 'name';cp_acm.width = this.CP1.width;
BindingUtils.bindProperty( dtc_acm,'selectedIndex',cp_acm,'selectedIndex' );
BindingUtils.bindProperty( cp_acm,'selectedItem',dtc_acm,'selectedItem' );
innerHBox.addChild( dtc_acm ); innerHBox.addChild( cp_acm );
I don't understand what may be happening here. Can anyone see any potential problems in my code? If I only keep it 1-way binding then it works fine. But both throw this error. Is there something about not only doing it 2-way in actionscript, but adding components that aren't on the stage yet?
Thank you kindly for any helpful tips,
Matt