Hi Bart,

Thanks for sending those logs.   I believe this is a bug fixed in LC DS 2.6 
which is now available on the adobe site.  We also have a hotfix for it on 
2.5.1 - contact me off list if you need a copy of that.

Jeff

From: Bart Ronsyn [mailto:[EMAIL PROTECTED]
Sent: Monday, July 28, 2008 1:03 AM
To: [email protected]
Cc: Jeff Vroom
Subject: Re: [flexcoders] LCDS - Data Management Service Problem

Hello Jeff,

In attachment you will find the flashlog.txt and the chatroomlogic.mxml, the 
component which connects to the "chatroom"
dataservice, manages an arraycollection of chatroom objects and results in the 
error described in my first mail.

Kind Regards
Bart Ronsyn


This error can occur when you access an unpaged item when paging is enabled of 
course, but given that you are running that code in the result handler it seems 
like this is not the problem (unless the result event is being delivered for 
another call on that data service).

It might also happen if the identities are not getting defined properly in 
ActionScript.   If you add <mx:TraceTarget/> and send along the resulting 
flashlog.txt, we can see what is happening from that.

Jeff

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Bart 
Ronsyn
Sent: Friday, July 25, 2008 8:12 AM
To: [email protected]
Cc: Bart Ronsyn
Subject: [flexcoders] LCDS - Data Management Service Problem


Hello,

I have a Data Management Service that uses a managed ArrayCollection of users.
When a user is added by one client, the other clients are notified by the Data 
Management Service, and I want
to loop through the ArrayCollection, using the code below, but I always get the 
following error :

Error: Item requested is not available. A request for the item is now pending.
    at 
mx.data::DataList/http://www.adobe.com/2006/flex/mx/internal::requestItemAt()<http://www.adobe.com/2006/flex/mx/internal::requestItemAt%28%29>[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\DataList.as:949]
    at 
mx.data::DataList/getItemAt()[C:\depot\flex\branches\enterprise_bridgeman\frameworks\mx\data\DataList.as:261]
    at 
mx.collections::ListCollectionView/getItemAt()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:431]
     ...

This error occurs when the line "users.getItemAt(j) as User" is executed.
It seems that although the length of the ArrayCollection users equals 1, I can 
not get the Item at position 0.  Maybe the update of the ArrayCollection
is not yet finished ? How can I loop through the ArrayCollection upon changes ?

        ...
        [Bindable]
        private var users:ArrayCollection;
        private var ds:DataService;

        private function init()
        {
          users = new ArrayCollection();
          //users.addEventListener(CollectionEvent.COLLECTION_CHANGE, 
refreshUsers);

          ds = new DataService("user");
          ...

          ds.autoSyncEnabled = true;
          ds.fill(users);

          ds.addEventListener(ResultEvent.RESULT, refreshUsers);
        }
        private function refreshUsers(evt:ResultEvent):void
        {
            trace ("refreshUsers" + users.length);

            for(var j:uint=0; j < users.length; j++)
            {
                var user:User = users.getItemAt(j) as User;

                showUserProfile(user);
            }
        }
       ...

Kind Regards
Bart Ronsyn







________________________________






No virus found in this incoming message.

Checked by AVG.

Version: 7.5.526 / Virus Database: 270.5.6/1574 - Release Date: 25/07/2008 16:27



<<inline: image001.jpg>>

<<inline: image002.jpg>>

Reply via email to