Is the entire ModelLocator [Bindable]?  If so, you may want to remove
than and add distinct events to the properties of the data model.
Otherwise, the List might get updated for any change to the model
instead of just when files changes

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Robert Was
Sent: Thursday, January 31, 2008 12:59 PM
To: [email protected]
Subject: Re: [flexcoders] setter and dataprovider issues

 

Maybe code fragment:
Edit form:
<mx:List dataProvider="{ModelLocator.getInstance().files}"
change="ModelLocator.getInstance().file=FileVO(ModelLocator.getInstance(
).files.getItemAt(filesList.selectedIndex));"
/>
...
<mx:TextInput id="descriptionTI"
text="{ModelLocator.getInstance().file.description}"

change="ModelLocator.getInstance().file.description=descriptionTI.text"/
>

ModelLocator:
...
public var file:FileVO;
public function set files(f:ArrayCollection):void{
_files=f;
var filter:FilesFilter=new FilesFilter()
_files.filterFunction=filter.filterFunction
_files.refresh()
}
public function get files():ArrayCollection{
return _files;
}
...

My problem is when I type in descriptionTI: first letter in file VO 
field changes and mx:List component lose selectedItem and highlight. 

 

Reply via email to