folderObj.children is an ArrayCollection.
Main Topics
Browse All Topicsvar res:ArrayCollection = event.result as ArrayCollection;
if(folderObj.children != null)
folderObj.children.addItem
In the above code, i am getting the following error.
Error: Bookmark no longer valid.
at ListCollectionViewCursor/s
at mx.collections::Hierarchic
at mx.collections::Hierarchic
at flash.events::EventDispatc
at flash.events::EventDispatc
at mx.collections::Hierarchic
at flash.events::EventDispatc
at flash.events::EventDispatc
at mx.collections::ListCollec
at mx.collections::ListCollec
at mx.collections::ListCollec
at flash.events::EventDispatc
at flash.events::EventDispatc
at mx.collections::ArrayList/
at mx.collections::ArrayList/
at mx.collections::ListCollec
at mx.collections::ListCollec
at com.zetainteractive.model.
at com.cynergysystems.tango::
at mx.rpc::AsyncToken/http://
at mx.rpc.events::ResultEvent
at mx.rpc::AbstractOperation/
at mx.rpc::AbstractInvoker/ht
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/ackno
at NetConnectionMessageRespon
at mx.messaging::MessageRespo
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
>> folderObj.children is an ArrayCollection
Good! Since an ArrayCollection extends ListCollectionView:
var res:ArrayCollection = event.result as ArrayCollection;
if(folderObj.children != null) {
var ac:ArrayCollection = folderObj.children as ArrayCollection;
ac.disableAutoUpdate();
ac.addItem(res[i]);
ac.enableAutoUpdate();
}
folderObj.children.enableA
same error is being shown in the above line.
Error: Bookmark no longer valid.
at ListCollectionViewCursor/s
at mx.collections::Hierarchic
at mx.controls.advancedDataGr
at mx.controls.advancedDataGr
at mx.controls::AdvancedDataG
at mx.controls::AdvancedDataG
at mx.controls.listClasses::A
at mx.controls.listClasses::A
at mx.controls::AdvancedDataG
at mx.controls::AdvancedDataG
at mx.controls.listClasses::A
at mx.managers::LayoutManager
at mx.managers::LayoutManager
at Function/http://adobe.com/
at mx.core::UIComponent/callL
at mx.core::UIComponent/callL
at flash.events::EventDispatc
at flash.events::EventDispatc
at mx.collections::Hierarchic
at flash.events::EventDispatc
at flash.events::EventDispatc
at mx.collections::ListCollec
at mx.collections::ListCollec
at mx.collections::ListCollec
at mx.collections::ListCollec
at mx.collections::ListCollec
at com.zetainteractive.model.
at com.cynergysystems.tango::
at mx.rpc::AsyncToken/http://
at mx.rpc.events::ResultEvent
at mx.rpc::AbstractOperation/
at mx.rpc::AbstractInvoker/ht
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/ackno
at NetConnectionMessageRespon
at mx.messaging::MessageRespo
>> The objects are not getting added to the folderObj, if i remove enableAutoUpdate().
Well, they are but the view doesn't show them due to disableAutoUpdate() call as the Flex help states:
Prevents changes to the collection itself and items within the collection from being dispatched by the view. Also prevents the view from updating the positions of items if the positions change in the collection.
But the above is followed by:
The changes will be queued and dispatched appropriately after enableAutoUpdate is called.
The disableAutoUpdate method acts cumulatively; the same number of calls to enableAutoUpdate are required for the view to dispatch events and refresh.
So, the question is: when calling enableAutoUpdate() again without having the problem...
It's clear that calling disableAutoUpdate() helps in avoiding the error.
Apparently calling enableAutoUpdate() is also needed if you want the view to be updated according to the changes.
But if you do at that point, you get the same error.
Maybe you should call it "later"...
Could you try this:
var res:ArrayCollection = event.result as ArrayCollection;
if(folderObj.children != null) {
folderObj.children.disable
folderObj.children.addItem
callLater(
public function():void {
folderObj.children.enableA
});
}
Business Accounts
Answer for Membership
by: zzynxPosted on 2009-07-02 at 00:48:33ID: 24761160
What is the type of "folderObj.children"? A ListCollectionView I suppose?
(res[i]);
Try replacing
var res:ArrayCollection = event.result as ArrayCollection;
if(folderObj.children != null)
folderObj.children.addItem
by
var res:ArrayCollection = event.result as ArrayCollection;
if(folderObj.children != null) {
var lcv:ListCollectionView = folderObj.children as ListCollectionView;
lcv.disableAutoUpdate();
lcv.addItem(res[i]);
lcv.enableAutoUpdate();
}