Instance of SelectDivisionInput is used as itemEditor for component id=“divisions” (extends LayoutComponent)
Method creationComplete is OK - dataProvider is populated; after that
on some event changeFilter is called and after some work in method resultLoad dataProvider is changed (i’ve watched it on debugging)
but that changes does NOT appear on the screen.
<component:EMultiSelectRowArray id="divisions"
data="{filter.divisions}"
idDataName="divId"
textDataName="divName"
changeEventName="objectIdChanged"
width="100%">
<component:itemEditor>
<mx:Component>
<directories:SelectDivisionInput objectId="{data.divId}"
text="{data.divName}"
editable="true"
width="100%"/>
</mx:Component>
</component:itemEditor>
</component:EMultiSelectRowArray>
public class SelectDivisionInput extends SelectObjectCombo
{
private static const LABEL_FIELD:String = "divName";
private static const DATA_FIELD:String = "divId";
[Bindable]
public var filterIncludeNotActual:Boolean = false;
private var _listForResControl:Boolean = false;
private var _creationComplete:Boolean = false;
public function SelectDivisionInput()
{
super();
useAsTextInput = false;
saveSpaceForButtons = false;
manualShowOpenButton = true;
showOpenButton = false;
showSearchButton = false;
labelField = LABEL_FIELD;
dataField = DATA_FIELD;
addEventListener(FlexEvent.CREATION_COMPLETE, creationComplete);
}
public function changeFilter(event:LoadDivisionsFormEvent):void
{
filterIncludeNotActual = event.includeNotActual;
loadData();
}
private function creationComplete(event:FlexEvent):void
{
_creationComplete = true;
loadData();
}
private function loadData():void
{
if ( _listForResControl )
{
var ev1:LoadDivisionsForResControlEvent =
new LoadDivisionsForResControlEvent(null);
ev1.handler = new Callback( ev1, resultLoad );
ev1.dispatch();
}
else
{
var ev2:LoadDivisionsEvent = new LoadDivisionsEvent(null,filterIncludeNotActual);
ev2.handler = new Callback(ev2, resultLoad);
ev2.dispatch();
}
}
private function resultLoad(event:CairngormEvent, result:ArrayCollection):void
{
dataProvider = new ArrayCollection(result.source);
var sort:Sort = new Sort();
sort.fields = [new SortField(LABEL_FIELD, true)];
dataProvider.sort = sort;
}
public function set listForResControl( value:Boolean ):void
{
if (_listForResControl == value) return;
_listForResControl = value;
if (!_creationComplete) return;
loadData();
}
public function get listForResControl():Boolean
{
return _listForResControl;
}
}