Taht should work. Set a var with a reference to the added item, then set selectedItem to tat reference. selectedItem requires a reference to an item in the dataProvider.
Tracy Spratt, Lariat Services, development services available _____ From: [email protected] [mailto:[email protected]] On Behalf Of Geoff White Sent: Sunday, December 13, 2009 7:20 PM To: [email protected]; [email protected] Subject: [SPAM] Re: [flexcoders] Re: Selecting an Item Programmatically after Adding it to List What happens if you set list.selectedItem = itemJustAdded? _____ From: steveb805 <[email protected]> To: [email protected] Sent: Sun, December 13, 2009 5:12:59 PM Subject: [flexcoders] Re: Selecting an Item Programmatically after Adding it to List BTW, "Do I need to resort to:" should really say: "Do I need to settle for", or something else, so as not to confuse :) --- In flexcod...@yahoogro ups.com <mailto:flexcoders%40yahoogroups.com> , "steveb805" <quantumcheesedog@ ...> wrote: > > Thought I'd run this by everyone. > > If you have a List, whose dataprovider (arraycollection) has an ac tive sort on it, how do you select a new Item immediately after an addItem call, programtically? > > I can't predict what slot it's going to end up at due to the sort. It used to be easy before the sort (you just select arraycollection. length-1) > > Do I need to resort to: > Using the collectionChange event, and then in the handler function, looking at the object in event.items[ 0], and then searching the arraycollection for the label field? > > Thanks, > Steve >

