I’ve read how to do this but I’m falling short on implementation. I want an updateComplete event to run once then remove the listener.
Here’s the component:
<mx:ComboBox
id="templatesCombo"
dataProvider="{lendersModel.fileTemplateComposites}"
prompt="Select Template"
width="200"
labelFunction="getTemplateName"
change="onViewTempComboChange(event)"
updateComplete="checkTemplatesLength(event);"/>
Here’s the handler:
private function checkTemplatesLength( event:FlexEvent ):void{
if( lendersModel.fileTemplateComposites.length == 1 ){
this.templatesCombo.selectedIndex = 1;
this.currentFileTemplate = templatesCombo.selectedItem as FileTemplateCompositeDTO;
this.templateActions_bb.updateButtonVisibility( 2, true ); // disable delete button
}
var cb:ComboBox = ComboBox( event.currentTarget )
cb.removeEventListener( FlexEvent.UPDATE_COMPLETE, checkTemplatesLength );
}
What am I missing? I thought this is how to do it from other posts I’ve read here.
Any tips will be greatly appreciated.
Thanks!
maybe it’s not attached as an event listener in the first place?! but i’m sure it works this way: