Make sure that you have a variable declared of type UserInfoVO somewhere in your code.  Otherwise the file is not getting linked in and therefore it is not getting serialized correctly.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Dave Kuncl
Sent: Tuesday, August 02, 2005 4:38 PM
To: [email protected]
Subject: RE: [flexcoders] Problem passing action script VOs using an array

 

The issue we are having has something to do with the casting…

 

The code doesn’t have a typo, there was a typo when transferring it to email….here is the code….

 

This doesn’t work….

 

 

public function onResult(event:Object) : Void {

  var infoArray : Array = event.result;

.

.

.

}

 

public function saveUserInfo(userInfoArray : Array) : Void {

 

  var call:Object = service.save(userInfoArray);

 

}

 

This does work….

 

public function saveUserInfo(userInfoArray : Array) : Void {

  var infoArray : Array = new Array();

 

  for (var i in userInfoArray) {

  var userInfo : UserInfoVO = new UserInfoVO();

                       

  userInfo.oid = userInfoArray[i].oid;

  userInfo.name = userInfoArray[i].name;

                         

  infoArray .addItem(userInfo);

 

  var call:Object = service.save(infoArray);

 

}

 

 

How do we check to see if the received array has correctly casted objects??

 


From: [email protected] [mailto:[email protected]] On Behalf Of Aldo Bucchi
Sent: Tuesday, August 02, 2005 2:52 PM
To: [email protected]
Subject: Re: [flexcoders] Problem passing action script VOs using an array

 

HI,

first, there are some typos in your code

  infoArray .addItem(>>activity<<);

var >>userIfno<< : UserInfoVO = new UserInfoVO();

second, check that the received array has correctly casted objects
(UserInfoVO ), perhaps you don't have if correctly configured. Note
that the second time you are not relying on flex to do the correct
casting.



On 8/2/05, Shahnavaz Alware <[EMAIL PROTECTED]> wrote:


>
> I am having a problem passing action script VOs to the backend using an
> Array.  Can someone tell me what I am missing here...
>
>  
>
> Here is an example of what I am trying to do:
>
>  
>
> First I get an array of VOs from the backend....
>
>  
>
> public function onResult(event:Object) : Void {
>
>   var infoArray : Array = event.result;
>
> .
>
> .
>
> .
>
> }
>
>  
>
> Then later I call the backend and pass back the array of VOs and this
> DOESN'T work because I get a class cast exception...
>
>  
>
> public function saveUserInfo(userInfoArray : Array) : Void {
>
>  
>
>   var call:Object = service.save(userInfoArray);
>
>  
>
> }
>
>  
>
> However, if I do the same thing, but create an array of new VOs and transfer
> all the values, this DOES work....
>
>  
>
> public function saveUserInfo(userInfoArray : Array) : Void {
>
>   var infoArray : Array = new Array();
>
>  
>
>   for (var i in userInfoArray) {
>
>   var userIfno : UserInfoVO = new UserInfoVO();
>
>                        
>
>   userIfno.oid = userInfoArray[i].oid;
>
>   userIfno.name = userInfoArray[i].activityId;
>
>                          
>
>   infoArray .addItem(activity);
>
>  
>
>   var call:Object = service.save(infoArray);
>
>  
>
> }
>
>  
>
>  
>
> I don't understand exactly what the problem is here, can anyone give insight
> to this issue?
>
>  
>
>  
>
> Thanks,
>
>  
>
> Dave
>
>  --
>  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
>  Computer software testing Macromedia flex Development
>  Software developer

>  ________________________________
>  YAHOO! GROUPS LINKS


>  Visit your group "flexcoders" on the web.
>  
>  To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>  
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

>  ________________________________



--
::::: Aldo Bucchi :::::
mobile (56) 8 429 8300




--
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
Computer software testing Macromedia flex Development
Software developer


YAHOO! GROUPS LINKS




Reply via email to