Fiz copy paste do teu código e funciona como esperas: - carregando no triângulo, inicialmente mostra a lista dos estudantes A,B,C - não escolho nada - clico no botão - carregando no triângulo, a combobox tem os novos estudantes Ax...
Perdi alguma coisa? MV 2009/10/22 PaulMan <[email protected]> > > Porque é que a Caixa de selecção ( Combo Box ) é actualizada com o > dados do dataProvider mas não o desenha. > Isto quando se clica no botão. > Modo de teste: > > Carregar no botão triangulo para baixo na combobox, para ver a lista , > mas não se deve seleccionar nenhum item da lista > > Carregar no botão no lado direito para carregar o novo dataProvider > > Carregar no botão triangulo para baixo na combobox, para ver novos > resultados na lista , mais uma vez não se deve seleccionar nenhum item > da lista > > e nada alterou... > > mas se efectuarmos um clic na lista actualiza... > > procurei methodos tipo redraw(), refresh() e nada.... > validateNow tambem não funciona. > > alguma ideia, se é um bug, como o resolver? > > Cumprimentos, > > > <?xml version="1.0" encoding="utf-8"?> > <!-- > http://blog.flexexamples.com/2008/05/10/displaying-specific-items-from-an-arraycollection-in-flex/ > --> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="vertical" > verticalAlign="middle" > backgroundColor="white" viewSourceURL="srcview/index.html" > creationComplete="init();" > > > <mx:Script> > <![CDATA[ > [Bindable] private var myArrayCollection:ArrayCollection = > new > ArrayCollection(); > > private function init():void{ > myArrayCollection= this.arrColl1; > //this.validateNow(); > } > > private function changeData():void{ > myArrayCollection= this.arrColl2; > //this.validateNow(); > } > ]]> > </mx:Script> > <mx:ArrayCollection id="arrColl1"> > <mx:source> > <mx:Array> > <mx:Object label="Student A" score="85" /> > <mx:Object label="Student B" score="48" /> > <mx:Object label="Student C" score="71" /> > <mx:Object label="Student D" score="88" /> > <mx:Object label="Student E" score="24" /> > <mx:Object label="Student F" score="64" /> > <mx:Object label="Student G" score="76" /> > <mx:Object label="Student H" score="76" /> > <mx:Object label="Student I" score="93" /> > <mx:Object label="Student J" score="88" /> > <mx:Object label="Student K" score="48" /> > <mx:Object label="Student L" score="76" /> > </mx:Array> > </mx:source> > </mx:ArrayCollection> > <mx:ArrayCollection id="arrColl2"> > <mx:source> > <mx:Array> > <mx:Object label="Student Ax" score="85" /> > <mx:Object label="Student Bx" score="48" /> > <mx:Object label="Student Cx" score="71" /> > <mx:Object label="Student Dx" score="88" /> > > </mx:Array> > </mx:source> > </mx:ArrayCollection> > <mx:ApplicationControlBar dock="true"> > <mx:ComboBox id="student" prompt="NONE_SELECTED" > labelField="label" > > dataProvider="{myArrayCollection}"/> > <mx:Button click="changeData();" > > > </mx:Button> > </mx:ApplicationControlBar> > > <mx:Label text="{myArrayCollection.getItemAt > (student.selectedIndex).label}" /> > > </mx:Application> > > > --~--~---------~--~----~------------~-------~--~----~ Recebeu esta mensagem porque está inscrito em Grupo "Mailing List da Comunidade Portuguesa de Rich Internet Applications - www.riapt.org" do Grupos Google. Para enviar mensagens para este grupo, envie um email para [email protected] Para anular a inscrição neste grupo, envie um email para [email protected] Para mais opções, visite este grupo em http://groups.google.com/group/riapt?hl=pt-PT -~----------~----~----~----~------~----~------~--~---
