У меня проблема с flex, которая вызывает головную боль!
Я добавляю объекты в ArrayCollection, но при этом другая ArrayCollection также собирает эти изменения, даже если привязка не происходит.
Я могу видеть из отладки, что два AC имеют один и тот же адрес, но по жизни я не могу понять, почему.
У меня есть две коллекции массивов:
model.index.rows //The main array collection
model.index.holdRows //The array collection that imitates the above
Эта фантомная привязка данных происходит только для первой итерации в цикле, а для всех остальных она просто записывает ее один раз.
Причина, по которой это вызывает проблемы, заключается в том, что он создает повторяющиеся записи в моей таблице данных.
public override function handleMessage(message:IMessage):void
{
super.handleMessage(message);
if (message is IndexResponse)
{
var response:IndexResponse = message as IndexResponse;
model.index.rows.removeAll();
model.index.indexIsEmpty = response.nullIndex;
if (model.index.indexIsEmpty !== true)
{
//Update the index model from the response. Note: each property of the row object will be shown in the UI as a column in the grid
response.index.forEach(function(entry:EntryData, i:int, a:Array):void
{
var row:Object = { fileID: entry.fileID, dadName: entry.dadName };
entry.tags.forEach(function(tag:Tag, i:int, a:Array):void
{
row[tag.name] = tag.value;
});
model.index.rows.addItem(row);
});
if(model.index.indexForNetworkView == true){
model.index.holdRows.source = model.index.holdRows.source.concat(model.index.rows.source);
model.index.indexCounter++;
model.index.indexForNetworkView = false;
controller.indexController.showNetwork(model.index.indexCounter);
}
model.index.rows.refresh();
controller.networkController.show();
}
}
Кто-нибудь еще, кто сталкивался с чем-то подобным, предлагает решение?