Try changing your function to look like this:

 

public class UserAssembler
{
public List loadUsers()
{
ArrayList list = new ArrayList();
int i = 0;

while( i < 20 )
{
i++;
UserVO myUser = new UserVO();
myUser.setID(i);
myUser.setAge(28);
myUser.setDisplayName("Tom");
myUser.setImage( "41.jpg");
myUser.setLocation( "LA, CA");
list.add( myUser );
}

return list;
}
}

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Bray
Sent: Wednesday, June 14, 2006 4:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] having trouble with DataService fill

 

I have a single destination called "users" with a very simple fill
method that just creates 20 VOs, plugs them into an ArrayList and
returns it. After the client-side ResultEvent, my ArrayCollection has
20 items but they all contain null. The FDS log for that response is
below and the fill method I'm using is below that. I'm assuming the
log is telling me that I'm creating a single VO and filling the other
slots with references to the first but I can't see how my Java code
could be doing that. I would expect to see 20 objects there. Any
ideas?

[Flex] Serializing AMF/RTMP response
Version: 3
(Command method=_result (0) trxId=2)
(Typed Object #0 'flex.data.messages.SequencedMessage')
sequenceId = 0
destination = "users"
headers = (Object #1)
dataMessage = null
correlationId = "9CE17E7D-206E-D862-4C1A-D3DE8FDA09D2"
messageId = "E0425ED2-442E-1D59-9268-65E07B1CD33C"
timestamp = 1.150310846596E12
clientId = "C62E3E72-1A8B-A06A-3A46-D3DE8DF0568E"
timeToLive = 0.0
sequenceProxies = null
sequenceSize = 20
body = (Array #2)
[0] = (Typed Object #3 'com.userplane.dashboard.UserVO')
sex = 0
age = 28
image = "41.jpg"
location = "LA, CA"
displayName = "Tom"
ID = 20
[1] = (Ref #3)
[2] = (Ref #3)
[3] = (Ref #3)
[4] = (Ref #3)
[5] = (Ref #3)
[6] = (Ref #3)
[7] = (Ref #3)
[8] = (Ref #3)
[9] = (Ref #3)
[10] = (Ref #3)
[11] = (Ref #3)
[12] = (Ref #3)
[13] = (Ref #3)
[14] = (Ref #3)
[15] = (Ref #3)
[16] = (Ref #3)
[17] = (Ref #3)
[18] = (Ref #3)
[19] = (Ref #3)

*******************************************************
//her'es the fill method:

public class UserAssembler
{
public List loadUsers()
{
ArrayList list = new ArrayList();
UserVO myUser;
int i = 0;

while( i < 20 )
{
i++;

myUser = new UserVO();
myUser.setID(i);
myUser.setAge(28);
myUser.setDisplayName("Tom");
myUser.setImage( "41.jpg");
myUser.setLocation( "LA, CA");
list.add( myUser );
}

return list;
}
}

Thanks,

Tom

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to