Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-28-2012, 06:14 AM   #1
flexyboy
Registered User
 
Join Date: Feb 2011
Posts: 22
Default arrayCollection content does not is not refreshed in loop

I have a for loop and within the loop I am calling a remote object method that returns an ArrayCollection. At each iteration of the loop the content of the ArrayCollection changes and I am setting the dataProvider of a ComboBox to that ArrayCollection in each iteration.

However, only my last ComboBox is being binded to the latest content of the ArrayCollection.

The remote_obj.getYN is the function that takes as parameter the value from the loop and as such as I mentioned above in each iteration the content of the arrayCollection changes due to this function being called.

Below is my code snippet:

public function myFunc():void{

for (roller = 0; roller < customizedFields_array.length; roller++) {
var newCol:FlexDataGridColumn = new FlexDataGridColumn();
remote_obj.getYN(customizedFields_array.getItemAt( roller).FLD);
newCol.filterComboBoxDataProvider = _YN;
newCol.filterComboBoxLabelField =customizedFields_array.getItemAt(roller).FLD;
newCol.filterComboBoxDataField =customizedFields_array.getItemAt(roller).FLD;
}
cols.push(newCol);
}
myDataGrid.columns = cols;
}
This is the getYN result function in Flex.

public function getYN_result(event:ResultEvent):void{
_YN = event.result as ArrayCollection;
}
Can someone tell me how to go around this issue? Many thanks for your precious help.
flexyboy is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:37 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.