我使用标签组件来显示 ArrayCollection 的长度。当我向集合中添加新项目时,如何更新它?
这是标签的文本字段:
text="{model.meetingInfo.documentList.length}"
这是将新项目添加到集合的处理程序:
var attachmentProgressVO:AttachmentProgressVO = new AttachmentProgressVO();
attachmentProgressVO.fileReference = file as File;
newAttachmentList.addItem(attachmentProgressVO);
checkIfUpdate(file as File, attachmentProgressVO);
meetingInfo.docsAndAttachmentsList.addItem(attachmentProgressVO);
我尝试添加这两行,但没有奏效:
meetingInfo.docsAndAttachmentsList.itemUpdated( attachmentProgressVO );
meetingInfo.docsAndAttachmentsList.refresh();
我也试过改变这个:
public var docsAndAttachmentsList:ArrayCollection = new ArrayCollection();
对此:
private var _docsAndAttachmentsList:ArrayCollection = new ArrayCollection();
..使用吸气剂和二传手,但这不起作用。
我没有使用正确的方法,是吗?