Hi ,
I actually modified the SharedCollectionExample locally to
have items added in the beginning in synchrinization change
handler. It works fine for me , here is what I did
In the SharedCollectionExample in the examples folder ,
add this line
_model.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE,onSynchronizationChange);
in the onCreationComplete() method where you first declare
SharedCollection Class.
And in the
private function
onSynchronizationChange(p_evt:CollectionNodeEvent):void
{
if ( _model.isSynchronized ) {
_model.addItem({State:"Nevada",Capital:"Carson City"});
_model.addItem({State:"California",Capital:"Sacramento"});
}
}
I can get multiple items( i.e. these two items i added) in
the very beginning. If you check that the model ( SharedCollection)
is synchronized and add within it the items it should work fine and
will give you an initial set of items. Also, shared collection has
a property called idField and it will index objects based on this
field value with duplicates being overwritten.
I hope this helps. Otherwise please copy fractions of code
where you are still finding problem.
Thanks
Hironmay Basu