Honestly I would first look into replacing your Objects with strongly typed objects, just create a simple class to represent your properties and make the Class Bindable. Accessing properties of a strongly typed object versus a dynamic Object is a considerable performance boost if you have a lot of data floating around.
The Flex help has a pretty in-depth data-binding chapter that is a good reference: http://livedocs.adobe.com/flex/3/html/help.html?content=databinding_2.html On Tue, Apr 15, 2008 at 11:25 AM, Dominic Pazula <[EMAIL PROTECTED]> wrote: > Daniel, > Thanks for the reply. You are correct, the text trick works because > of the change on the selected item. This is what I am trying to > programatically define. > > The List contains static items. I need a property on an object bound > to a property of the selectedItem. > > I will look into the ChangeWatcher class. I'm still trying to learn > and understand how Binding works. If you know of a good tutorial or > explanation, could you please let me know. > > Thanks > Dominic > > --- In [email protected] <flexcoders%40yahoogroups.com>, "Daniel > Gold" <[EMAIL PROTECTED]> > wrote: > > > > > Binding will not work with dynamic objects, which it sounds like > you're > > using. I have a feeling your invisible text field trick is only > working when > > you switch selectedItem. Seems like if you kept the same item > selected and > > the TYPE property changed on that item, the binding would not fire, > but > > since selectedItem was in your MXML binding chain, a binding will > fire > > anytime you select a different item in the list, then it will pull > out the > > TYPE property and update your text field. > > > > If you don't really need binding and just need to update when a > selection > > changes, you could always listen for the itemClicked property or > add a > > ChangeWatcher for the list.selectedItem property and call a > function that > > pulls out the TYPE property and updates your currentOp object. > > > > On Tue, Apr 15, 2008 at 8:55 AM, Dominic Pazula <[EMAIL PROTECTED]> wrote: > > > > > I have a List Component whose dataProvider is an > ArrayCollection of > > > generic objects. > > > > > > I have another object I would like to bind a property of to a > > > property to the selectedItem of the List. > > > > > > I have: > > > BindingUtils.bindProperty > > > (currentOp,"type",this.columnList.selectedItem,"TYPE"); > > > > > > No go... I see that the binding util cannot work with the property > > > TYPE on the generic object, does not implement IEventDispatcher, > > > etc. I get why it doesn't work. > > > > > > So if I add > > > <mx:Text id="selectedType" > text="{this.columnList.selectedItem.TYPE}" > > > visable="false"/> > > > > > > and > > > BindingUtils.bindProperty > (currentOp,"type",this.selectedType,"text"); > > > > > > it works. > > > > > > I would prefer NOT to have a bunch of invisible text fields > running > > > around. How can I accomplish this in AS? > > > > > > Thanks > > > Dom > > > > > > > > > > > > > >

