Re: [flexcoders] ArrayCollection of VO's Memory Leak??

2009-10-23 Thread Jake Churchill
Ah, for anyone else curious, you have to take a memory snapshot before this
will work

On Fri, Oct 23, 2009 at 3:06 PM, Alex Harui  wrote:

>
>
>  Double click on the object and it should show you all references to that
> object.
>
>
>
> Alex Harui
>
> Flex SDK Developer
>
> Adobe Systems Inc. <http://www.adobe.com/>
>
> Blog: http://blogs.adobe.com/aharui
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Jake Churchill
> *Sent:* Friday, October 23, 2009 9:30 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] ArrayCollection of VO's Memory Leak??
>
>
>
>
>
> Where do you go to see that?  All I can see is the number of instances an
> object has and the memory those instances take up?
>
> On Fri, Oct 23, 2009 at 1:10 AM, Alex Harui  wrote:
>
>
>
> The profiler should be able to show you who is still referencing the
> objects.
>
>
>
> Alex Harui
>
> Flex SDK Developer
>
> Adobe Systems Inc. <http://www.adobe.com/>
>
> Blog: http://blogs.adobe.com/aharui
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Jake Churchill
> *Sent:* Thursday, October 22, 2009 10:57 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] ArrayCollection of VO's Memory Leak??
>
>
>
>
>
> Hi all,
>
> I have a charting application where I have an ArrayCollection of VO's.  The
> chart has several series, each looking at one property in the VO.
>
> There are several controls that when changed, require a re-calculation of
> the VO's in the ArrayCollection.  Before I do the re-calculation, I call
> .removeAll() on the ArrayCollection and re-populate it with new VO's.
>
> When I run the profiler, my VO instances grow with each re-calculation.
> So, why doesn't the garbage collector take care of the objects that got
> removed from the ArrayCollection?  How can I fix this?
>
> Please help.
>
> Thanks!
>
> -Jake
>
>
>
>   
>


RE: [flexcoders] ArrayCollection of VO's Memory Leak??

2009-10-23 Thread Alex Harui
Double click on the object and it should show you all references to that object.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Jake Churchill
Sent: Friday, October 23, 2009 9:30 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection of VO's Memory Leak??



Where do you go to see that?  All I can see is the number of instances an 
object has and the memory those instances take up?
On Fri, Oct 23, 2009 at 1:10 AM, Alex Harui 
mailto:aha...@adobe.com>> wrote:

The profiler should be able to show you who is still referencing the objects.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of Jake Churchill
Sent: Thursday, October 22, 2009 10:57 AM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] ArrayCollection of VO's Memory Leak??



Hi all,

I have a charting application where I have an ArrayCollection of VO's.  The 
chart has several series, each looking at one property in the VO.

There are several controls that when changed, require a re-calculation of the 
VO's in the ArrayCollection.  Before I do the re-calculation, I call 
.removeAll() on the ArrayCollection and re-populate it with new VO's.

When I run the profiler, my VO instances grow with each re-calculation.  So, 
why doesn't the garbage collector take care of the objects that got removed 
from the ArrayCollection?  How can I fix this?

Please help.

Thanks!

-Jake




Re: [flexcoders] ArrayCollection of VO's Memory Leak??

2009-10-23 Thread Jake Churchill
Where do you go to see that?  All I can see is the number of instances an
object has and the memory those instances take up?

On Fri, Oct 23, 2009 at 1:10 AM, Alex Harui  wrote:

>
>
>  The profiler should be able to show you who is still referencing the
> objects.
>
>
>
> Alex Harui
>
> Flex SDK Developer
>
> Adobe Systems Inc. 
>
> Blog: http://blogs.adobe.com/aharui
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Jake Churchill
> *Sent:* Thursday, October 22, 2009 10:57 AM
> *To:* flexcoders@yahoogroups.com
> *Subject:* [flexcoders] ArrayCollection of VO's Memory Leak??
>
>
>
>
>
> Hi all,
>
> I have a charting application where I have an ArrayCollection of VO's.  The
> chart has several series, each looking at one property in the VO.
>
> There are several controls that when changed, require a re-calculation of
> the VO's in the ArrayCollection.  Before I do the re-calculation, I call
> .removeAll() on the ArrayCollection and re-populate it with new VO's.
>
> When I run the profiler, my VO instances grow with each re-calculation.
> So, why doesn't the garbage collector take care of the objects that got
> removed from the ArrayCollection?  How can I fix this?
>
> Please help.
>
> Thanks!
>
> -Jake
>
>   
>


RE: [flexcoders] ArrayCollection of VO's Memory Leak??

2009-10-22 Thread Alex Harui
The profiler should be able to show you who is still referencing the objects.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Jake Churchill
Sent: Thursday, October 22, 2009 10:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection of VO's Memory Leak??



Hi all,

I have a charting application where I have an ArrayCollection of VO's.  The 
chart has several series, each looking at one property in the VO.

There are several controls that when changed, require a re-calculation of the 
VO's in the ArrayCollection.  Before I do the re-calculation, I call 
.removeAll() on the ArrayCollection and re-populate it with new VO's.

When I run the profiler, my VO instances grow with each re-calculation.  So, 
why doesn't the garbage collector take care of the objects that got removed 
from the ArrayCollection?  How can I fix this?

Please help.

Thanks!

-Jake



RE: [flexcoders] ArrayCollection filterFunction returning item in array;

2009-08-07 Thread Alex Harui
I think you want

return statusGroup.indexOf(item.STATUSID) != -1

Make sure STATUSID is a number/int and not a String, or convert it.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of kpjj31
Sent: Friday, August 07, 2009 3:02 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection filterFunction returning item in array;



Is it possible to use the ArrayCollection filterFunction that returns items 
from an Array?

This returns null...

private function filterStatus(item:Object):Boolean {

var statusgroup:Array = [0, 1, 88, 44];
return item.STATUSID in (statusgroup);

}



RE: [flexcoders] ArrayCollection filterFunction returning item in array;

2009-08-07 Thread Tracy Spratt
No, the in operator is used to determine if an object has a particular
property.  With Array, it will tell you if an index is within the bounds of
the array.

 

In your case, if STATUSID is an integer, it will return true for value
0,1,2,3.

 

I am not sure why it is returning null.  Split the code up into smaller
parts and debug it.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of kpjj31
Sent: Friday, August 07, 2009 6:02 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection filterFunction returning item in
array;

 

  


Is it possible to use the ArrayCollection filterFunction that returns items
from an Array?

This returns null...

private function filterStatus(item:Object):Boolean { 

var statusgroup:Array = [0, 1, 88, 44];
return item.STATUSID in (statusgroup);

} 





Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-08-03 Thread Angelo Anolin
Hi Tracy,
apologies that it took me quite a while to reply and continue this. been 
sidetracked on another project.

anyway, when I have passed the xmllistcollection as string to .net, what method 
would i use to parse the information in the .net side?

thanks.

regards,

Angelo




From: Tracy Spratt 
To: flexcoders@yahoogroups.com
Sent: Wednesday, 8 July, 2009 12:48:27
Subject: RE: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService





var sXML:String = “”;
sXML += myXMLListCollection .toXMLSTring( );
sXML+= “ _
  Public Function setUserPermits(ByVal sRowsXml As String, ByVal sSId As 
String) As DataTable
…
 
 
 
Tracy Spratt,
Lariat Services, development services available



From:flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On 
Behalf Of Angelo Anolin
Sent: Tuesday, July 07, 2009 8:09 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService
 




Hi Tracy,
 
I would certainly appreciate if you could point me in the right direction on 
using XMLListCollection and sending it back to .NET as a string.  
 
Thanks.
 
Regards,
 
Angelo
 



From:Tracy Spratt 
To: flexcod...@yahoogro ups.com
Sent: Tuesday, 7 July, 2009 4:45:56
Subject: RE: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService
Why not use XMLListCollection and send the xml to .net as a string?  There is 
little value in building an ArrayCollection of generic obects.  You can 
sort/filter an XMLListCollection.
 
XML is more verbose than some other methods, but if bandwidth is truly an 
issue, then you should be looking at a binary protocol.
 
Tracy Spratt,
Lariat Services, development services available



From:flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On 
Behalf Of Angelo Anolin
Sent: Friday, July 03, 2009 2:09 AM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService
 



Hi Sam,
Basically this is the process which I am using.
 
.NET
Retrieve records from Oracle DB and store the same into a dataset.  Return the 
dataset as XML string via the command DataSet.GetXML.
 
Flex
In the event handler of my webservice method call, I parse the string into XML, 
then ArrayCollection via the following codes:
 
private var _xmlData:XML;
[Bindable] private var arrDP:ArrayCollecti on = new ArrayCollection;
_xmlData = XML(event.result) ;
var oTemp:Object;
var xl:XMLList = _xmlData.children( );
var i:int;
for(i = 0; i < xl.length(); i++)  
{
 oTemp = {NAME:xl[i]. NAME.text( ), TEAM:xl[i].TEAM. text(), 
    JERSEY :xl[i] .JERSEY.text( ), MANAGER:xl[i] .MANAGER. text()};
 arrDP.addItem( oTemp);
}
 
and in my datagrid, I am setting its dataProvider to the arrDP variable.
 
I used Array Collection because I implemented a search and filter functionality 
which searches and filters the data accordingly for the dataprovider which is 
then reflected back to the datagrid.
Now, when I need to return the ArrayCollection to .NET, I simply pass the same 
as a parameter to a .NET function which accepts ArrayList as parameter.
 
.NET
Once the function receieves the arraycollection (which is then now an array 
list), I get the arrays inside the arraylist and get the values inside the 
array. 
 
I think by doing things like this, it may not be the best way.
 
You mentioned you'd map the XML to typed objects in .NET.  How can I do this?
 
Instead of using arraycollection as dataprovider in my datagrid, can I use 
another which would be much easier when I pass back to the .NET function?
 
Whats the best way to interact large set of data (datasets) between .NET and 
Flex?
 
Thanks a lot.

 
 



From:Sam Lai 
To: flexcod...@yahoogro ups.com
Sent: Friday, 3 July, 2009 13:52:12
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService
Instead of using an array list and trying to emulate the type-less
abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
does the XML from your Flex app differ too wildly to do this?

Are you using the XmlSerializer to deserialize this? Or are you using
WCF? Or are you doing it some other way, or manually?

I'd provide an example, but I don't know enough details on your
situation to give something useful :)

2009/7/3 Angelo Anolin :
>
>
> Hi Sam,
>
> Care to show some examples? I am parsing the arrayCollection into an
> ArrayList on .NET.  This is particularly not too appealing since I just
> discovered that for example, if one of the objects in the arraycollection
> would have an empty string value, the number of items inside the array is
> not reflected properly in .NET.
>
> Like:
>
> priv

RE: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-07 Thread Tracy Spratt
var sXML:String = "";

sXML += myXMLListCollection.toXMLSTring();

sXML+= " _

  Public Function setUserPermits(ByVal sRowsXml As String, ByVal sSId As
String) As DataTable

.

 

 

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Angelo Anolin
Sent: Tuesday, July 07, 2009 8:09 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
Passed to .NET WebService

 






Hi Tracy,

 

I would certainly appreciate if you could point me in the right direction on
using XMLListCollection and sending it back to .NET as a string.  

 

Thanks.

 

Regards,

 

Angelo

 

  _  

From: Tracy Spratt 
To: flexcoders@yahoogroups.com
Sent: Tuesday, 7 July, 2009 4:45:56
Subject: RE: [flexcoders] ArrayCollection Does Not Show Items In Order When
Passed to .NET WebService

Why not use XMLListCollection and send the xml to .net as a string?  There
is little value in building an ArrayCollection of generic obects.  You can
sort/filter an XMLListCollection.

 

XML is more verbose than some other methods, but if bandwidth is truly an
issue, then you should be looking at a binary protocol.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On
Behalf Of Angelo Anolin
Sent: Friday, July 03, 2009 2:09 AM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
Passed to .NET WebService

 





Hi Sam,

Basically this is the process which I am using.

 

.NET
Retrieve records from Oracle DB and store the same into a dataset.  Return
the dataset as XML string via the command DataSet.GetXML.

 

Flex
In the event handler of my webservice method call, I parse the string into
XML, then ArrayCollection via the following codes:

 

private var _xmlData:XML;
[Bindable] private var arrDP:ArrayCollecti on = new ArrayCollection;

_xmlData = XML(event.result) ;
var oTemp:Object;
var xl:XMLList = _xmlData.children( );

var i:int;
for(i = 0; i < xl.length(); i++)  
{
 oTemp = {NAME:xl[i]. NAME.text( ), TEAM:xl[i].TEAM. text(), 
JERSEY :xl[i] .JERSEY.text( ), MANAGER:xl[i] .MANAGER. text()};
 arrDP.addItem( oTemp);
}

 

and in my datagrid, I am setting its dataProvider to the arrDP variable.

 

I used Array Collection because I implemented a search and filter
functionality which searches and filters the data accordingly for the
dataprovider which is then reflected back to the datagrid.

Now, when I need to return the ArrayCollection to .NET, I simply pass the
same as a parameter to a .NET function which accepts ArrayList as parameter.

 

.NET
Once the function receieves the arraycollection (which is then now an array
list), I get the arrays inside the arraylist and get the values inside the
array. 

 

I think by doing things like this, it may not be the best way.

 

You mentioned you'd map the XML to typed objects in .NET.  How can I do
this?

 

Instead of using arraycollection as dataprovider in my datagrid, can I use
another which would be much easier when I pass back to the .NET function?

 

Whats the best way to interact large set of data (datasets) between .NET and
Flex?

 

Thanks a lot.


 

 

  _  

From: Sam Lai 
To: flexcod...@yahoogro ups.com
Sent: Friday, 3 July, 2009 13:52:12
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
Passed to .NET WebService

Instead of using an array list and trying to emulate the type-less
abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
does the XML from your Flex app differ too wildly to do this?

Are you using the XmlSerializer to deserialize this? Or are you using
WCF? Or are you doing it some other way, or manually?

I'd provide an example, but I don't know enough details on your
situation to give something useful :)

2009/7/3 Angelo Anolin mailto:angelo_anolin%40yahoo.com>
yahoo.com>:
>
>
> Hi Sam,
>
> Care to show some examples? I am parsing the arrayCollection into an
> ArrayList on .NET.  This is particularly not too appealing since I just
> discovered that for example, if one of the objects in the arraycollection
> would have an empty string value, the number of items inside the array is
> not reflected properly in .NET.
>
> Like:
>
> private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:"001" ,
> Value:"Select" },
> {ID:"002",
> Value:"Choose" },
> {ID:"003",
> Value:""},]) ;
>
> When I pass this var arrR into a .NET webservice and delegate it to an
> ArrayList, the items in the array list will have one of the arrays only
> contai

Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-07 Thread Angelo Anolin
Hi Tracy,

I would certainly appreciate if you could point me in the right direction on 
using XMLListCollection and sending it back to .NET as a string.  

Thanks.

Regards,

Angelo





From: Tracy Spratt 
To: flexcoders@yahoogroups.com
Sent: Tuesday, 7 July, 2009 4:45:56
Subject: RE: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService





Why not use XMLListCollection and send the xml to .net as a string?  There is 
little value in building an ArrayCollection of generic obects.  You can 
sort/filter an XMLListCollection.
 
XML is more verbose than some other methods, but if bandwidth is truly an 
issue, then you should be looking at a binary protocol.
 
Tracy Spratt,
Lariat Services, development services available



From:flexcod...@yahoogro ups.com [mailto: flexcod...@yahoogro ups.com ] On 
Behalf Of Angelo Anolin
Sent: Friday, July 03, 2009 2:09 AM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService
 




Hi Sam,
Basically this is the process which I am using.
 
.NET
Retrieve records from Oracle DB and store the same into a dataset.  Return the 
dataset as XML string via the command DataSet.GetXML.
 
Flex
In the event handler of my webservice method call, I parse the string into XML, 
then ArrayCollection via the following codes:
 
private var _xmlData:XML;
[Bindable] private var arrDP:ArrayCollecti on = new ArrayCollection;
_xmlData = XML(event.result) ;
var oTemp:Object;
var xl:XMLList = _xmlData.children( );
var i:int;
for(i = 0; i < xl.length(); i++)  
{
 oTemp = {NAME:xl[i]. NAME.text( ), TEAM:xl[i].TEAM. text(), 
    JERSEY :xl[i] .JERSEY.text( ), MANAGER:xl[i] .MANAGER. text()};
 arrDP.addItem( oTemp);
}
 
and in my datagrid, I am setting its dataProvider to the arrDP variable.
 
I used Array Collection because I implemented a search and filter functionality 
which searches and filters the data accordingly for the dataprovider which is 
then reflected back to the datagrid.
Now, when I need to return the ArrayCollection to .NET, I simply pass the same 
as a parameter to a .NET function which accepts ArrayList as parameter.
 
.NET
Once the function receieves the arraycollection (which is then now an array 
list), I get the arrays inside the arraylist and get the values inside the 
array. 
 
I think by doing things like this, it may not be the best way.
 
You mentioned you'd map the XML to typed objects in .NET.  How can I do this?
 
Instead of using arraycollection as dataprovider in my datagrid, can I use 
another which would be much easier when I pass back to the .NET function?
 
Whats the best way to interact large set of data (datasets) between .NET and 
Flex?
 
Thanks a lot.

 
 



From:Sam Lai 
To: flexcod...@yahoogro ups.com
Sent: Friday, 3 July, 2009 13:52:12
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService
Instead of using an array list and trying to emulate the type-less
abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
does the XML from your Flex app differ too wildly to do this?

Are you using the XmlSerializer to deserialize this? Or are you using
WCF? Or are you doing it some other way, or manually?

I'd provide an example, but I don't know enough details on your
situation to give something useful :)

2009/7/3 Angelo Anolin :
>
>
> Hi Sam,
>
> Care to show some examples? I am parsing the arrayCollection into an
> ArrayList on .NET.  This is particularly not too appealing since I just
> discovered that for example, if one of the objects in the arraycollection
> would have an empty string value, the number of items inside the array is
> not reflected properly in .NET.
>
> Like:
>
> private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:"001" ,
> Value:"Select" },
> {ID:"002",
> Value:"Choose" },
>     {ID:"003",
> Value:""},]) ;
>
> When I pass this var arrR into a .NET webservice and delegate it to an
> ArrayList, the items in the array list will have one of the arrays only
> containing 1 item (instead of 2).
>
> Adding to my problem is the fact that the arrays inside the array list when
> read in .NET should have the object ID and Value be in order but they are
> not.  This is further true when there are many items in the array
> collection.  Sometimes, the first item becomes the last one in the array
> list, and sometimes the order is not well.
>
> In any case, I am finding a solution on how I would be able to pass an
> ArrayCollection to .NET and be able to parse it properly.
>
> Thanks.
>
> __

Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-07 Thread Angelo Anolin
Hi Sam Lai,

THanks for the input and my apologies for replying late since I felt the need 
to get deeper on the issue I am encountering.

In my web service, the arraycollection is received as an array list and yes, it 
is like an array of xml nodes.

In my arraycollection, say I have 5 columns and when one of the columns 
contains an empty string, when I pass it to my .NET webservice, the arraylist 
will have an array which only contains 4 columns (instead of the expected 5).  
That is why the empty field is actually causing me some problems.

I am trying to find some E4x documentation / article specifically tackling this 
kind of .NET and Flex integration. Do you know of some?

Thanks and regards,

Angelo





From: Sam Lai 
To: flexcoders@yahoogroups.com
Sent: Saturday, 4 July, 2009 12:54:53
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService





I just wrote up a simple C# web service that accepts an ArrayList:

[WebMethod]
public bool ArrayListTest( System.Collectio ns.ArrayList a)
{ ... }

Then in Flex I wrote this,




http://localhost: 63868/Service1. asmx?WSDL" id="ws">



When sendWebServiceCall is triggered, it calls the C# web service and
passes the ArrayCollection to it.

In the web service, the ArrayCollection is received as an array list
of XmlNodes. Each XmlNode contains a node for each field, even if it
is an empty string.

http://tempuri. org/">808
http://tempuri. org/">bob

http://tempuri. org/">
http://tempuri. org/">fred

Is this anything like what you're getting? The edge case you described
in another email about an empty string causing problems doesn't seem
to cause problems.

Also see inline.

2009/7/3 Angelo Anolin :
> I think by doing things like this, it may not be the best way.
>
> You mentioned you'd map the XML to typed objects in .NET.  How can I do
> this?

As you're using a dataset, this isn't really an option. A dataset as
opposed to a collection of typed objects are two ways of handling data
from data sources; it is arguable which way is better.

The problem in your case, is that the XML generated as a result of
passing an ArrayCollection to a web service method cannot be passed
into the dataset's readXml method. (Even if it could by inferring a
schema, it would be different to your database's schema.)

The only way I know of to do seamless transfer of data without having
to parse XML is to use WebORB. Otherwise you will have to parse the
XML produced on both sides to re-create the dataset/object.

> Instead of using arraycollection as dataprovider in my datagrid, can I use
> another which would be much easier when I pass back to the .NET function?

I wonder if it is possible to bind your datagrid directly to the e4x
XML? That way you can pass the entire XML doc back to .NET via the web
service, and hence you can re-create the dataset using
dataset.readXML.

>  _ _____ __
> From: Sam Lai 
> To: flexcod...@yahoogro ups.com
> Sent: Friday, 3 July, 2009 13:52:12
> Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
> Passed to .NET WebService
>
> Instead of using an array list and trying to emulate the type-less
> abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
> does the XML from your Flex app differ too wildly to do this?
>
> Are you using the XmlSerializer to deserialize this? Or are you using
> WCF? Or are you doing it some other way, or manually?
>
> I'd provide an example, but I don't know enough details on your
> situation to give something useful :)
>
> 2009/7/3 Angelo Anolin :
>>
>>
>> Hi Sam,
>>
>> Care to show some examples? I am parsing the arrayCollection into an
>> ArrayList on .NET.  This is particularly not too appealing since I just
>> discovered that for example, if one of the objects in the arraycollection
>> would have an empty string value, the number of items inside the array is
>> not reflected properly in .NET.
>>
>> Like:
>>
>> private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:"001" ,
>> Value:"Select" },
>> {ID:"002",
>> Value:"Choose" },
>>     {ID:"003",
>> Value:""},]) ;
>>
>> When I pass this var arrR into a .NET webservice and delegate it to an
>> ArrayList, the items in the array list will have one of the arrays only
>> containing 1 item (instead of 2).
>>
>> Adding to my problem is the fact that the arrays inside the array list
>> when
>> read in .NET should have th

RE: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-06 Thread Tracy Spratt
Why not use XMLListCollection and send the xml to .net as a string?  There
is little value in building an ArrayCollection of generic obects.  You can
sort/filter an XMLListCollection.

 

XML is more verbose than some other methods, but if bandwidth is truly an
issue, then you should be looking at a binary protocol.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Angelo Anolin
Sent: Friday, July 03, 2009 2:09 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
Passed to .NET WebService

 






Hi Sam,

Basically this is the process which I am using.

 

.NET
Retrieve records from Oracle DB and store the same into a dataset.  Return
the dataset as XML string via the command DataSet.GetXML.

 

Flex
In the event handler of my webservice method call, I parse the string into
XML, then ArrayCollection via the following codes:

 

private var _xmlData:XML;
[Bindable] private var arrDP:ArrayCollection = new ArrayCollection;

_xmlData = XML(event.result);
var oTemp:Object;
var xl:XMLList = _xmlData.children();

var i:int;
for(i = 0; i < xl.length(); i++)  
{
 oTemp = {NAME:xl[i].NAME.text(), TEAM:xl[i].TEAM.text(), 
JERSEY:xl[i].JERSEY.text(), MANAGER:xl[i].MANAGER.text()};
 arrDP.addItem(oTemp);
}

 

and in my datagrid, I am setting its dataProvider to the arrDP variable.

 

I used Array Collection because I implemented a search and filter
functionality which searches and filters the data accordingly for the
dataprovider which is then reflected back to the datagrid.

Now, when I need to return the ArrayCollection to .NET, I simply pass the
same as a parameter to a .NET function which accepts ArrayList as parameter.

 

.NET
Once the function receieves the arraycollection (which is then now an array
list), I get the arrays inside the arraylist and get the values inside the
array. 

 

I think by doing things like this, it may not be the best way.

 

You mentioned you'd map the XML to typed objects in .NET.  How can I do
this?

 

Instead of using arraycollection as dataprovider in my datagrid, can I use
another which would be much easier when I pass back to the .NET function?

 

Whats the best way to interact large set of data (datasets) between .NET and
Flex?

 

Thanks a lot.


 

 

  _  

From: Sam Lai 
To: flexcoders@yahoogroups.com
Sent: Friday, 3 July, 2009 13:52:12
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
Passed to .NET WebService

Instead of using an array list and trying to emulate the type-less
abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
does the XML from your Flex app differ too wildly to do this?

Are you using the XmlSerializer to deserialize this? Or are you using
WCF? Or are you doing it some other way, or manually?

I'd provide an example, but I don't know enough details on your
situation to give something useful :)

2009/7/3 Angelo Anolin mailto:angelo_anolin%40yahoo.com>
yahoo.com>:
>
>
> Hi Sam,
>
> Care to show some examples? I am parsing the arrayCollection into an
> ArrayList on .NET.  This is particularly not too appealing since I just
> discovered that for example, if one of the objects in the arraycollection
> would have an empty string value, the number of items inside the array is
> not reflected properly in .NET.
>
> Like:
>
> private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:"001" ,
> Value:"Select" },
> {ID:"002",
> Value:"Choose" },
> {ID:"003",
> Value:""},]) ;
>
> When I pass this var arrR into a .NET webservice and delegate it to an
> ArrayList, the items in the array list will have one of the arrays only
> containing 1 item (instead of 2).
>
> Adding to my problem is the fact that the arrays inside the array list
when
> read in .NET should have the object ID and Value be in order but they are
> not.  This is further true when there are many items in the array
> collection.  Sometimes, the first item becomes the last one in the array
> list, and sometimes the order is not well.
>
> In any case, I am finding a solution on how I would be able to pass an
> ArrayCollection to .NET and be able to parse it properly.
>
> Thanks.
>
>  _________ _____ __
> From: Sam Lai mailto:samuel.lai%40gmail.com> >
> To: flexcod...@yahoogro ups.com <mailto:flexcoders%40yahoogroups.com> 
> Sent: Thursday, 2 July, 2009 15:46:58
> Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order
When
> Passed to .NET WebService
>
> How is it being parsed in .NET? You can parse it into a hashta

Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-03 Thread Sam Lai
I just wrote up a simple C# web service that accepts an ArrayList:

[WebMethod]
public bool ArrayListTest(System.Collections.ArrayList a)
{ ... }

Then in Flex I wrote this,




http://localhost:63868/Service1.asmx?WSDL"; id="ws">



When sendWebServiceCall is triggered, it calls the C# web service and
passes the ArrayCollection to it.

In the web service, the ArrayCollection is received as an array list
of XmlNodes. Each XmlNode contains a node for each field, even if it
is an empty string.

http://tempuri.org/";>808
http://tempuri.org/";>bob

http://tempuri.org/";>
http://tempuri.org/";>fred

Is this anything like what you're getting? The edge case you described
in another email about an empty string causing problems doesn't seem
to cause problems.

Also see inline.

2009/7/3 Angelo Anolin :
> I think by doing things like this, it may not be the best way.
>
> You mentioned you'd map the XML to typed objects in .NET.  How can I do
> this?

As you're using a dataset, this isn't really an option. A dataset as
opposed to a collection of typed objects are two ways of handling data
from data sources; it is arguable which way is better.

The problem in your case, is that the XML generated as a result of
passing an ArrayCollection to a web service method cannot be passed
into the dataset's readXml method. (Even if it could by inferring a
schema, it would be different to your database's schema.)

The only way I know of to do seamless transfer of data without having
to parse XML is to use WebORB. Otherwise you will have to parse the
XML produced on both sides to re-create the dataset/object.

> Instead of using arraycollection as dataprovider in my datagrid, can I use
> another which would be much easier when I pass back to the .NET function?

I wonder if it is possible to bind your datagrid directly to the e4x
XML? That way you can pass the entire XML doc back to .NET via the web
service, and hence you can re-create the dataset using
dataset.readXML.

> ________
> From: Sam Lai 
> To: flexcoders@yahoogroups.com
> Sent: Friday, 3 July, 2009 13:52:12
> Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
> Passed to .NET WebService
>
> Instead of using an array list and trying to emulate the type-less
> abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
> does the XML from your Flex app differ too wildly to do this?
>
> Are you using the XmlSerializer to deserialize this? Or are you using
> WCF? Or are you doing it some other way, or manually?
>
> I'd provide an example, but I don't know enough details on your
> situation to give something useful :)
>
> 2009/7/3 Angelo Anolin :
>>
>>
>> Hi Sam,
>>
>> Care to show some examples? I am parsing the arrayCollection into an
>> ArrayList on .NET.  This is particularly not too appealing since I just
>> discovered that for example, if one of the objects in the arraycollection
>> would have an empty string value, the number of items inside the array is
>> not reflected properly in .NET.
>>
>> Like:
>>
>> private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:"001" ,
>> Value:"Select" },
>> {ID:"002",
>> Value:"Choose" },
>>     {ID:"003",
>> Value:""},]) ;
>>
>> When I pass this var arrR into a .NET webservice and delegate it to an
>> ArrayList, the items in the array list will have one of the arrays only
>> containing 1 item (instead of 2).
>>
>> Adding to my problem is the fact that the arrays inside the array list
>> when
>> read in .NET should have the object ID and Value be in order but they are
>> not.  This is further true when there are many items in the array
>> collection.  Sometimes, the first item becomes the last one in the array
>> list, and sometimes the order is not well.
>>
>> In any case, I am finding a solution on how I would be able to pass an
>> ArrayCollection to .NET and be able to parse it properly.
>>
>> Thanks.
>>
>>  _ _ __
>> From: Sam Lai 
>> To: flexcod...@yahoogro ups.com
>> Sent: Thursday, 2 July, 2009 15:46:58
>> Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order
>> When
>> Passed to .NET WebService
>>
>> How is it being parsed in .NET? You can parse it into a hashtable, or
>> better yet, use a pre-defined object.
>>
>> Not sure why the order is different, but it is probably fragile to
>> rely on 

Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-02 Thread Angelo Anolin
Hi Sam,
Basically this is the process which I am using.

.NET
Retrieve records from Oracle DB and store the same into a dataset.  Return the 
dataset as XML string via the command DataSet.GetXML.

Flex
In the event handler of my webservice method call, I parse the string into XML, 
then ArrayCollection via the following codes:

private var _xmlData:XML;
[Bindable] private var arrDP:ArrayCollection = new ArrayCollection;
_xmlData = XML(event.result);
var oTemp:Object;
var xl:XMLList = _xmlData.children();
var i:int;
for(i = 0; i < xl.length(); i++)  
{
 oTemp = {NAME:xl[i].NAME.text(), TEAM:xl[i].TEAM.text(), 
    JERSEY:xl[i].JERSEY.text(), MANAGER:xl[i].MANAGER.text()};
 arrDP.addItem(oTemp);
}

and in my datagrid, I am setting its dataProvider to the arrDP variable.

I used Array Collection because I implemented a search and filter functionality 
which searches and filters the data accordingly for the dataprovider which is 
then reflected back to the datagrid.
Now, when I need to return the ArrayCollection to .NET, I simply pass the same 
as a parameter to a .NET function which accepts ArrayList as parameter.

.NET
Once the function receieves the arraycollection (which is then now an array 
list), I get the arrays inside the arraylist and get the values inside the 
array. 

I think by doing things like this, it may not be the best way.

You mentioned you'd map the XML to typed objects in .NET.  How can I do this?

Instead of using arraycollection as dataprovider in my datagrid, can I use 
another which would be much easier when I pass back to the .NET function?

Whats the best way to interact large set of data (datasets) between .NET and 
Flex?

Thanks a lot.

 




From: Sam Lai 
To: flexcoders@yahoogroups.com
Sent: Friday, 3 July, 2009 13:52:12
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService





Instead of using an array list and trying to emulate the type-less
abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
does the XML from your Flex app differ too wildly to do this?

Are you using the XmlSerializer to deserialize this? Or are you using
WCF? Or are you doing it some other way, or manually?

I'd provide an example, but I don't know enough details on your
situation to give something useful :)

2009/7/3 Angelo Anolin :
>
>
> Hi Sam,
>
> Care to show some examples? I am parsing the arrayCollection into an
> ArrayList on .NET.  This is particularly not too appealing since I just
> discovered that for example, if one of the objects in the arraycollection
> would have an empty string value, the number of items inside the array is
> not reflected properly in .NET.
>
> Like:
>
> private var arrR:ArrayCollectio n = new ArrayCollection( [{ID:"001" ,
> Value:"Select" },
> {ID:"002",
> Value:"Choose" },
>     {ID:"003",
> Value:""},]) ;
>
> When I pass this var arrR into a .NET webservice and delegate it to an
> ArrayList, the items in the array list will have one of the arrays only
> containing 1 item (instead of 2).
>
> Adding to my problem is the fact that the arrays inside the array list when
> read in .NET should have the object ID and Value be in order but they are
> not.  This is further true when there are many items in the array
> collection.  Sometimes, the first item becomes the last one in the array
> list, and sometimes the order is not well.
>
> In any case, I am finding a solution on how I would be able to pass an
> ArrayCollection to .NET and be able to parse it properly.
>
> Thanks.
>
>  _ _ __
> From: Sam Lai 
> To: flexcod...@yahoogro ups.com
> Sent: Thursday, 2 July, 2009 15:46:58
> Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
> Passed to .NET WebService
>
> How is it being parsed in .NET? You can parse it into a hashtable, or
> better yet, use a pre-defined object.
>
> Not sure why the order is different, but it is probably fragile to
> rely on the order in this case.
>
> 2009/7/2 Angelo Anolin :
>>
>>
>> Hi FlexCoders,
>>
>> I have an array collection which I am populating as follows:
>>
>> var oTemp:Object;
>> var xl:XMLList = _xmlData.children( );
>> var i:int;
>> for(i = 0; i < xl.length(); i++)
>> {
>>  oTemp = {ID_TAG:xl[i] .ID.text( ), CAT_TAG:xl[i] .CAT.text( ),
>> DET_TAG:xl[i] .DET.text( ), REP_DATE_TAG: xl[i].REP_ DATE.text( ),
>> IND_TAG:xl[i] .IND.text( )};
>>  arrDP.addItem( oTemp);
>> }
>> Now, when I pass back this Array Collection back into a web service, the
>> 

Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-02 Thread Sam Lai
Instead of using an array list and trying to emulate the type-less
abilities of AS3, I'd try to map the XML to typed objects in .NET. Or
does the XML from your Flex app differ too wildly to do this?

Are you using the XmlSerializer to deserialize this? Or are you using
WCF? Or are you doing it some other way, or manually?

I'd provide an example, but I don't know enough details on your
situation to give something useful :)

2009/7/3 Angelo Anolin :
>
>
> Hi Sam,
>
> Care to show some examples? I am parsing the arrayCollection into an
> ArrayList on .NET.  This is particularly not too appealing since I just
> discovered that for example, if one of the objects in the arraycollection
> would have an empty string value, the number of items inside the array is
> not reflected properly in .NET.
>
> Like:
>
> private var arrR:ArrayCollection = new ArrayCollection([{ID:"001",
> Value:"Select"},
> {ID:"002",
> Value:"Choose"},
>     {ID:"003",
> Value:""},]);
>
> When I pass this var arrR into a .NET webservice and delegate it to an
> ArrayList, the items in the array list will have one of the arrays only
> containing 1 item (instead of 2).
>
> Adding to my problem is the fact that the arrays inside the array list when
> read in .NET should have the object ID and Value be in order but they are
> not.  This is further true when there are many items in the array
> collection.  Sometimes, the first item becomes the last one in the array
> list, and sometimes the order is not well.
>
> In any case, I am finding a solution on how I would be able to pass an
> ArrayCollection to .NET and be able to parse it properly.
>
> Thanks.
>
> 
> From: Sam Lai 
> To: flexcoders@yahoogroups.com
> Sent: Thursday, 2 July, 2009 15:46:58
> Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When
> Passed to .NET WebService
>
> How is it being parsed in .NET? You can parse it into a hashtable, or
> better yet, use a pre-defined object.
>
> Not sure why the order is different, but it is probably fragile to
> rely on the order in this case.
>
> 2009/7/2 Angelo Anolin :
>>
>>
>> Hi FlexCoders,
>>
>> I have an array collection which I am populating as follows:
>>
>> var oTemp:Object;
>> var xl:XMLList = _xmlData.children( );
>> var i:int;
>> for(i = 0; i < xl.length(); i++)
>> {
>>  oTemp = {ID_TAG:xl[i] .ID.text( ), CAT_TAG:xl[i] .CAT.text( ),
>> DET_TAG:xl[i] .DET.text( ), REP_DATE_TAG: xl[i].REP_ DATE.text( ),
>> IND_TAG:xl[i] .IND.text( )};
>>  arrDP.addItem( oTemp);
>> }
>> Now, when I pass back this Array Collection back into a web service, the
>> fields are not in order as I have added them into the array collection.
>>
>> I am expecting that in my Web Service, when I parse this arraycollection
>> (via arraylist), I would be getting the same order of columns as I have
>> added them, i.e. the first array in the array list would have element 0 to
>> be the value I placed in the ID.
>>
>> Since the arraylist does not have the field tag (represented by ID_TAG,
>> DET_TAG, CAT_TAG, etc..), it becomes a trial and error (hit and miss) on
>> my
>> part since I can only reference the value via the index on the array.
>>
>> Now, how would I be able to include the tags inside array collection such
>> that when I read them as an array list in my .NET webservice, I know which
>> element I am referring to in a particular index.
>>
>> Thanks.
>>
>> Regards,
>> Angelo
>>
>>
>>
>
>
>
> 


Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-02 Thread Angelo Anolin
Hi Sam,

Care to show some examples? I am parsing the arrayCollection into an ArrayList 
on .NET.  This is particularly not too appealing since I just discovered that 
for example, if one of the objects in the arraycollection would have an empty 
string value, the number of items inside the array is not reflected properly in 
.NET.

Like:

private var arrR:ArrayCollection = new ArrayCollection([{ID:"001", 
Value:"Select"},
{ID:"002", 
Value:"Choose"},
    {ID:"003", Value:""},]);

When I pass this var arrR into a .NET webservice and delegate it to an 
ArrayList, the items in the array list will have one of the arrays only 
containing 1 item (instead of 2).

Adding to my problem is the fact that the arrays inside the array list when 
read in .NET should have the object ID and Value be in order but they are not.  
This is further true when there are many items in the array collection.  
Sometimes, the first item becomes the last one in the array list, and sometimes 
the order is not well.

In any case, I am finding a solution on how I would be able to pass an 
ArrayCollection to .NET and be able to parse it properly.

Thanks.





From: Sam Lai 
To: flexcoders@yahoogroups.com
Sent: Thursday, 2 July, 2009 15:46:58
Subject: Re: [flexcoders] ArrayCollection Does Not Show Items In Order When 
Passed to .NET WebService





How is it being parsed in .NET? You can parse it into a hashtable, or
better yet, use a pre-defined object.

Not sure why the order is different, but it is probably fragile to
rely on the order in this case.

2009/7/2 Angelo Anolin :
>
>
> Hi FlexCoders,
>
> I have an array collection which I am populating as follows:
>
> var oTemp:Object;
> var xl:XMLList = _xmlData.children( );
> var i:int;
> for(i = 0; i < xl.length(); i++)
> {
>  oTemp = {ID_TAG:xl[i] .ID.text( ), CAT_TAG:xl[i] .CAT.text( ),
> DET_TAG:xl[i] .DET.text( ), REP_DATE_TAG: xl[i].REP_ DATE.text( ),
> IND_TAG:xl[i] .IND.text( )};
>  arrDP.addItem( oTemp);
> }
> Now, when I pass back this Array Collection back into a web service, the
> fields are not in order as I have added them into the array collection.
>
> I am expecting that in my Web Service, when I parse this arraycollection
> (via arraylist), I would be getting the same order of columns as I have
> added them, i.e. the first array in the array list would have element 0 to
> be the value I placed in the ID.
>
> Since the arraylist does not have the field tag (represented by ID_TAG,
> DET_TAG, CAT_TAG, etc..), it becomes a trial and error (hit and miss) on my
> part since I can only reference the value via the index on the array.
>
> Now, how would I be able to include the tags inside array collection such
> that when I read them as an array list in my .NET webservice, I know which
> element I am referring to in a particular index.
>
> Thanks.
>
> Regards,
> Angelo
>
>
> 




  

Re: [flexcoders] ArrayCollection Does Not Show Items In Order When Passed to .NET WebService

2009-07-02 Thread Sam Lai
How is it being parsed in .NET? You can parse it into a hashtable, or
better yet, use a pre-defined object.

Not sure why the order is different, but it is probably fragile to
rely on the order in this case.

2009/7/2 Angelo Anolin :
>
>
> Hi FlexCoders,
>
> I have an array collection which I am populating as follows:
>
> var oTemp:Object;
> var xl:XMLList = _xmlData.children();
> var i:int;
> for(i = 0; i < xl.length(); i++)
> {
>  oTemp = {ID_TAG:xl[i].ID.text(), CAT_TAG:xl[i].CAT.text(),
> DET_TAG:xl[i].DET.text(), REP_DATE_TAG:xl[i].REP_DATE.text(),
> IND_TAG:xl[i].IND.text()};
>  arrDP.addItem(oTemp);
> }
> Now, when I pass back this Array Collection back into a web service, the
> fields are not in order as I have added them into the array collection.
>
> I am expecting that in my Web Service, when I parse this arraycollection
> (via arraylist), I would be getting the same order of columns as I have
> added them, i.e. the first array in the array list would have element 0 to
> be the value I placed in the ID.
>
> Since the arraylist does not have the field tag (represented by ID_TAG,
> DET_TAG, CAT_TAG, etc..), it becomes a trial and error (hit and miss) on my
> part since I can only reference the value via the index on the array.
>
> Now, how would I be able to include the tags inside array collection such
> that when I read them as an array list in my .NET webservice, I know which
> element I am referring to in a particular index.
>
> Thanks.
>
> Regards,
> Angelo
>
>
> 


Re: [flexcoders] ArrayCollection/Min Max Problem

2009-06-30 Thread Sam Lai
Maybe your trace statement is in the wrong place? Seeing your code
would help in solving the problem.

Another way to solve these problems is to sort the data (sub)set, then
just pull the first and last elements. Depending on what you want to
do with the data after, this may be faster.

2009/7/1 Sherif Abdou :
>
>
> I have an array collection and I am trying to find the Min/Max of the values
> in groups. For Example my array collection has 100 values. I want to find
> the Min Value/Max Value between 1 to 26, 2 to 27, 3 to 28 , etc I tried
> to create 2 for loops in each other but for some reason during
> debugging/tracing it outputs wrong numbers, but if i do breakpoint then step
> in. I get the correct values. So the question is is there a better way than
> what i am doing. I am just trying to create a Stochastic formula.
>
>
>
> 


RE: [flexcoders] ArrayCollection | DataGrid | SortonColumn

2009-04-08 Thread Alex Harui
A full stack trace with line numbers is like a fingerprint.  Very helpful when 
doing detective work.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of ilikeflex
Sent: Wednesday, April 08, 2009 12:06 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection | DataGrid | SortonColumn





Hi

I have datagrid with 150 records. I do sorting when someone clicks on datagrid. 
And i am using the ArrayCollection as dataprovider to the datagrid.When user 
changes the option in combo box then show the new data in the datagrid.

In my command class i am doing

MessagesModel.getInstance().messageList.removeAll();
and then adding the new records.

Sometime i am getting the error
RangeError: Index '-1' specified is out of bounds.

but if i do not do the sort everthing is fine.

Any pointers ...

Thanks
ilikeflex



RE: [flexcoders] arraycollection vs listcollectionview

2009-03-27 Thread Alex Harui
You should be able to get what you want if you set it up correctly.  The AC and 
LCV should be separate instances sharing the same source or list property

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Scott
Sent: Friday, March 27, 2009 4:57 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] arraycollection vs listcollectionview

That's a nasty little bug.

I haven't encountered that myself yet but I can see where that would happen.

You may want to change your remove function to fire only on a button click and 
not a component update (component.remove).

 Scott


From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of arieljake
Sent: Friday, March 27, 2009 1:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] arraycollection vs listcollectionview


I'm confused.

I have an ArrayCollection. And I listen for the COLLECTION_CHANGE.Remove event 
to know when to delete the item from the database.

For displaying the contents of my ArrayCollection, i am using a 
ListCollectionView with a filter function applied to it, so that the filter 
function does not affect all views using the same ArrayCollection.

But, when I change the value of a property on an item in the ArrayCollection 
that causes the filter to now filter OUT the item, the ListCollectionView 
dispatches a COLLECTION_CHANGE.Remove event.

This causes my code to remove the item from the db, undesirably.

Now I understand that the ListCollectionView must dispatch these events to 
update the ListBase, but why isn't the target different so that I can tell 
whether the Remove event came from the ArrayCollection itself or just a 
ListCollectionView of it?

--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.



RE: [flexcoders] arraycollection vs listcollectionview

2009-03-27 Thread Scott
That's a nasty little bug.

 

I haven't encountered that myself yet but I can see where that would
happen.

 

You may want to change your remove function to fire only on a button
click and not a component update (component.remove).

 

 Scott

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of arieljake
Sent: Friday, March 27, 2009 1:33 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] arraycollection vs listcollectionview

 

I'm confused.

I have an ArrayCollection. And I listen for the COLLECTION_CHANGE.Remove
event to know when to delete the item from the database.

For displaying the contents of my ArrayCollection, i am using a
ListCollectionView with a filter function applied to it, so that the
filter function does not affect all views using the same
ArrayCollection.

But, when I change the value of a property on an item in the
ArrayCollection that causes the filter to now filter OUT the item, the
ListCollectionView dispatches a COLLECTION_CHANGE.Remove event.

This causes my code to remove the item from the db, undesirably.

Now I understand that the ListCollectionView must dispatch these events
to update the ListBase, but why isn't the target different so that I can
tell whether the Remove event came from the ArrayCollection itself or
just a ListCollectionView of it? 




-- 
This message has been scanned for viruses and 
dangerous content by MailScanner  , and is

believed to be clean. 


RE: [flexcoders] ArrayCollection or XML

2009-03-11 Thread Tracy Spratt
In all cases, use the appropriate API to navigate to the desired data
object, then access the data via the methods and properties provided by that
object.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of tiend...@ezweb.ne.jp
Sent: Wednesday, March 11, 2009 9:20 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection or XML

 

Hi all guru,

[Database Table]
id
firstname
lastname

At Backend I use PHP and Mysql. PHP script can return Array or XML string.
At Flex app, I use Remote Object

1)PHP script return Array:
and in Flex code I get Array as :

dp = new ArrayCollection( ArrayUtil.toArray(event.result));

If I show dp in Datagrid or List, TileList -> it OK . But I want to get
value of firstname , lastname into textbox . I don't know , can flex do that
? And how to get value from ArrayCollection.

2)PHP script return XML string :

I don't know how to parse XML string and show result in textbox. And how to
get value from XML string.

Please help me or any idea

Thanks





RE: [flexcoders] ArrayCollection vs XMLListCollection

2009-02-22 Thread Alex Harui
If you don't specify columns, the DataGrid uses ObjectUtil.getClassInfo to get 
the list of properties.  For XML, getClassInfo returns the attributes and not 
the child nodes

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Jeffry Houser
Sent: Sunday, February 22, 2009 2:24 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection vs XMLListCollection


Some code magic in the background.
I bet if you drill down into the component code for DataGrid and/or
DataGridColumn you'll find comments that explain this.

If I had to guess, it is relatively [knock on wood] easy to parse an
object and find the properties on it. I think a for loop will do it.

But, XML is much open in terms of "where do I find data" than an
ArrayCollection of objects would be.

brad.bueche wrote:
> How come when I'm setting up a data grid using an ArrayCollection as
> the datasource I dont have to specify the contents of the data grid
> columns? I can just do this:
>
>  dataProvider="{bookData.lastResult.books.stock}" />
>
> But in order to get anything to appear on the data grid with either XML
> or XMLListCollection I have to do the column layout (like this)?
>
>  dataProvider="{bookStock2}" >
> 
> 
> 
> 
> 
> 
> 
>
> Thanks in advance,
> brad
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>

--
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711 | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust



Re: [flexcoders] ArrayCollection vs XMLListCollection

2009-02-22 Thread Jeffry Houser

 Some code magic in the background. 
 I bet if you drill down into the component code for DataGrid and/or 
DataGridColumn you'll find comments that explain this.

 If I had to guess, it is relatively [knock on wood] easy to parse an 
object and find the properties on it.  I think a for loop will do it.

 But, XML is much open in terms of "where do I find data" than an 
ArrayCollection of objects would be.


brad.bueche wrote:
> How come when I'm setting up a data grid using an ArrayCollection as 
> the datasource I dont have to specify the contents of the data grid 
> columns?  I can just do this:
>
> dataProvider="{bookData.lastResult.books.stock}" />
>
> But in order to get anything to appear on the data grid with either XML 
> or XMLListCollection I have to do the column layout (like this)?
>
> dataProvider="{bookStock2}" >
>  
>   
>   
>   
>   
>  
> 
>
> Thanks in advance,
> brad
>
>
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Alternative FAQ location: 
> https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
> Search Archives: 
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
>
>
>
>
>   

-- 
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711  | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust




RE: [flexcoders] ArrayCollection DataProvider question.

2009-02-11 Thread Tracy Spratt
That is not as bad as I thought it might be(I was expecting to see the
default resultFormat.  E4x is good!), but it is a bit odd.  You are
manually building an ArrayCollection of XML nodes.

 

I don't see any reason to do that.  Just use XMLListCollection, and
avoid the loop.

 

Now, "best practice", or at least this list's apparent consensus of best
practice, is to do what you are doing, but instead of adding xml nodes,
you populate a strongly data typed "Value Object" and add tht to the
ArrayCollection.  This is probably the most efficient and performant
approach.

 

But I mostly use XML and XMLListCollection.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of - -
Sent: Wednesday, February 11, 2009 9:37 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.

 

Hi Tracy, this is how I get the XML info into an ArrayCollection:

 



 

private function get_days(event:ResultEvent):void

{

Arraydays.removeAll();

XMLdays = event.result as XML;

for each(var ourxml:XML in XMLdays.elements())
Arraydays.addItem(ourxml);

}

Is this ok?

 

Thanks

 

-David

 



From: Tracy Spratt 
To: flexcoders@yahoogroups.com
Sent: Tuesday, February 10, 2009 4:19:53 PM
Subject: RE: [flexcoders] ArrayCollection DataProvider question.

I suggest using e4x expressions against the XML, and then putting the
result in an XMLListCollection.

var xlResults:XMLList = xmlData.result. (attribute("id") == "1");

trace(xlResults. toXMLString( ));  //to verify your data

xlcResults = new XMLListCollection( xlResults) ;

 

You did not say how you got your XML into an ArrayCollection, but I
suspect it is not the good way.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcod...@yahoogro ups.com <http://ups.com/>  [mailto:flexcoders@
yahoogroups. com] On Behalf Of Henrique
Sent: Tuesday, February 10, 2009 2:19 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.

 

Humm, you have to make a filterFunction, like this:

 

private function filterFucntion( item:Object) :Boolean

{

   return item.id <http://item.id/>  == "1";

}

 

Henrique F. Marino

blog.dclick. com.br <http://blog.dclick.com.br/> 

www.dclick.com. br <http://www.dclick.com.br/> 

On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21 mailto:sailorse...@yahoo.com> > wrote:

I loaded the following xml as an ArrayCollection. 



today
13154
654321 


yesterday
21354
5468432 


today
2665
4256 


yesterday
7425
7542 



How can I use this as a dataprovider but only using the values in 
 and not ?

My arraycollection var is "Arraydays".
I tried {Arraydays.( @id=='2')} but it gave me an error: Error #1123: 
Filter operator...

Thanks.

 

 





Re: [flexcoders] ArrayCollection DataProvider question.

2009-02-11 Thread - -
Hi Tracy, this is how I get the XML info into an ArrayCollection:



privatefunctionget_days(event:ResultEvent):void{
Arraydays.removeAll();
XMLdays = event.result asXML;foreach(varourxml:XML inXMLdays.elements()) 
Arraydays.addItem(ourxml);}

Is this ok?

Thanks

-David




From: Tracy Spratt 
To: flexcoders@yahoogroups.com
Sent: Tuesday, February 10, 2009 4:19:53 PM
Subject: RE: [flexcoders] ArrayCollection DataProvider question.


I suggest using e4x expressions against the XML, and then putting the result in 
an XMLListCollection.
var xlResults:XMLList = xmlData.result. (attribute(“id”) == “1”);
trace(xlResults. toXMLString( ));  //to verify your data
xlcResults = new XMLListCollection( xlResults) ;
 
You did not say how you got your XML into an ArrayCollection, but I suspect it 
is not the good way.
Tracy Spratt
Lariat Services
Flex development bandwidth available



From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of Henrique
Sent: Tuesday, February 10, 2009 2:19 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.
 
Humm, you have to make a filterFunction, like this:
 
private function filterFucntion( item:Object) :Boolean
{
   return item.id == "1";
}
 
Henrique F. Marino
blog.dclick. com.br
www.dclick.com. br
On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21  wrote:
I loaded the following xml as an ArrayCollection. 



today
13154
654321 


yesterday
21354
5468432 


today
2665
4256 


yesterday
7425
7542 



How can I use this as a dataprovider but only using the values in 
 and not ?

My arraycollection var is "Arraydays".
I tried {Arraydays.( @id=='2')} but it gave me an error: Error #1123: 
Filter operator...

Thanks.
 



  

RE: [flexcoders] ArrayCollection DataProvider question.

2009-02-10 Thread Tracy Spratt
I suggest using e4x expressions against the XML, and then putting the
result in an XMLListCollection.

var xlResults:XMLList = xmlData.result.(attribute("id") == "1");

trace(xlResults.toXMLString());  //to verify your data

xlcResults = new XMLListCollection(xlResults);

 

You did not say how you got your XML into an ArrayCollection, but I
suspect it is not the good way.

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Henrique
Sent: Tuesday, February 10, 2009 2:19 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection DataProvider question.

 

Humm, you have to make a filterFunction, like this:

 

private function filterFucntion(item:Object):Boolean

{

   return item.id == "1";

}

 

Henrique F. Marino

blog.dclick.com.br <http://blog.dclick.com.br> 

www.dclick.com.br <http://www.dclick.com.br> 

On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21 mailto:sailorse...@yahoo.com> > wrote:

I loaded the following xml as an ArrayCollection. 



today
13154
654321 


yesterday
21354
5468432 


today
2665
4256 


yesterday
7425
7542 



How can I use this as a dataprovider but only using the values in 
 and not ?

My arraycollection var is "Arraydays".
I tried {Arraydays.(@id=='2')} but it gave me an error: Error #1123: 
Filter operator...

Thanks.

 





Re: [flexcoders] ArrayCollection DataProvider question.

2009-02-10 Thread Henrique
Humm, you have to make a filterFunction, like this:
private function filterFucntion(item:Object):Boolean
{
   return item.id == "1";
}

Henrique F. Marino
blog.dclick.com.br
www.dclick.com.br

On Tue, Feb 10, 2009 at 3:35 PM, sailorsea21  wrote:

>   I loaded the following xml as an ArrayCollection.
>
> 
> 
> today
> 13154
> 654321
> 
> 
> yesterday
> 21354
> 5468432
> 
> 
> today
> 2665
> 4256
> 
> 
> yesterday
> 7425
> 7542
> 
> 
>
> How can I use this as a dataprovider but only using the values in
>  and not ?
>
> My arraycollection var is "Arraydays".
> I tried {Arraydays.(@id=='2')} but it gave me an error: Error #1123:
> Filter operator...
>
> Thanks.
>
>  
>


RE: [flexcoders] ArrayCollection COLLECTION_CHANGE event doesn't fire right away?

2009-01-23 Thread Alex Harui
DG editing is session and row-based by default.  Data isn't written back to the 
data object until you change cells, and notifications are blocked until you 
change rows.

For click-based cells like checkbox, I usually add a change handler that sets 
the field right away.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Keith Hughitt
Sent: Friday, January 23, 2009 8:24 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection COLLECTION_CHANGE event doesn't fire 
right away?


Hi all,

I'm trying to detect changes in an ArrayCollection which is bound to a
DataGrid with some editable components. For some reason, however, the
event only seems to fire when the focus is change. For example, I
check a check-box, and nothing happens. When I then click somewhere
outside of the checkbox, the event is fired. Furthermore, If I check
the box twice before changing focus, nothing at all happens.

Is is possible that the event is only fired when the DataCollection is
refreshed, and that the refresh is not occurring until the focus changes?

Here is an example of what I'm doing ("colors" is the id for the
DataGrid associated with the colors ArrayC:

import mx.collections.ArrayCollection;
import mx.events.CollectionEvent;
import mx.controls.Alert;

[Bindable]
private var colors:ArrayCollection = new ArrayCollection([
{color:"Red", display: true},
{color:"Blue", display: true},
{color:"Green", display: true}
]);

// Watch for changes to DataGrid CheckBox's
private function init():void {
colors.addEventListener(
CollectionEvent.COLLECTION_CHANGE, onChange
);
}

public function onChange(evt:Event):void {
Alert.show("Datagrid altered!");
}

Any ideas? Any advice would be greatly appreciated.

Thanks!
Keith





RE: [flexcoders] arraycollection merge

2008-12-06 Thread Alex Harui
This might help: 
http://blogs.adobe.com/aharui/2008/03/custom_ilists_checkboxdatagrid_1.html

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of hworke
Sent: Saturday, December 06, 2008 5:31 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] arraycollection merge



Hi I have three different arraycollections and
I want to bind them all as dataprovider to a
datagrid. How do I do that? Can a datagrid have
have 3 dataprovider and can it display all these
dataproviders' info at the same time? Or I do
need to merge my three arraycollections into one
and then bind them to the grid? If I do need to
merge the arraycollections together than what is
the easiest way to do so?

Regards



Re: [flexcoders] ArrayCollection

2008-11-14 Thread Mike Duncan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tracy Spratt wrote:
> 
> 
> The issue is that there is only one “lastResult” for the entire framework.
> 
>  
> 
> “There is only one result” No, this is not correct. Because they are
> asynchronous, there can be multiple pending RPC data calls.  There is no
> assurance that the first RPC call is the first returned.

I guess I just have not developed large enough applications to see what
you are stating here. I normally create a HTTPService object then call
1-2 asynchronous calls depending on user interaction with the app.

> 
>  
> 
> Between the time the result returns, lastResult is set, the result event
> is dispatched, calling your handler, and your handler gets to the line
> that uses lastResult, it is very possible that another result has
> returned, overwriting the value in lastResult.  Typically it is actually
> set to null by the framework, rather than sneaking in some other data,
> but that is just as dangerous.  This was a real issue in a thread six or
> eight months ago.

This all really depends on how you develop the application. I am not
saying you are wrong or stating something incorrectly, just that this
example is not relevant to most people creating small/medium apps. Most
people are doing good to even have a single HTTPService object within
their code.

> 
>  
> 
> If you only call a single RPC at a time, there will be no problem, but
> complex apps often have many outstanding calls an a given moment.

Ah, I see. I appreciate the insight.

> 
>  
> 
> Why take any risk?  Is there some reason you **like** lastResult over
> using the event.result object? 

I am not taking a side on anything really. I am just stating that in my
little experience, as well as documentation and other resources read,
that the lastResult-method is used by the vast majority. I personally
appreciate you explaining the lastResult vs. event.result methods.

> 
>  
> 
> Tracy

Thanks Tracy.


Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED]
828.271.4289
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJHYjRnvIkv6fg9hYRAp70AJ9OmP12rFwDLt3kpaqnqQy5HUal4QCgh5M+
CQ/SARSS/VwHgD/bnClVvAQ=
=fwzL
-END PGP SIGNATURE-


Re: [flexcoders] ArrayCollection

2008-11-13 Thread Fotis Chatzinikos
Ok, had not noticed the http bit, as the initial post mentioned RPC and in
my mind/head RPC == RemoteObject..

and i do not have any similar problems with remote object calls :-)

On Thu, Nov 13, 2008 at 11:42 PM, Tracy Spratt <[EMAIL PROTECTED]>wrote:

>The issue is typically with resultFormat="object", which is the
> default.  The source of the data is irrelevant.
>
>
>
> It is a well known issue, search on it for lots of discussion.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Fotis Chatzinikos
> *Sent:* Thursday, November 13, 2008 4:21 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] ArrayCollection
>
>
>
> Sorry is that a problem with Cold Fusion?
>
> I get single element ArrayCollections from by java backend all the time (I
> think? :-)
>
> On Thu, Nov 13, 2008 at 11:32 PM, Tracy Spratt <[EMAIL PROTECTED]>
> wrote:
>
> Mike,
>
> It is dangerous to use lastResult in this manner:
>
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
>
> You are not garrunteed that it will have the value in the result you
> expect.
>
> In most cases it will work ok but the correct way is:
>
> scans = new ArrayCollection([event.result.vector.scan]);
>
>
>
> lastResult is intended only for use in binding expressions.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Mike Duncan
> *Sent:* Thursday, November 13, 2008 3:06 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] ArrayCollection
>
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> This is how I got around this...
>
> - -
> import mx.uils.ObjectProxy;
> import mx.collections.ArrayCollection;
>
> [Bindable] private scans:ArrayCollection;
>
> private function handleGetScansResults(event:ResultEvent):void {
> //Note: getScan is a HTTPService object.
> if(getScan.lastResult.vector.scan is ObjectProxy) {
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> }else{
> scans = getScan.lastResult.vector.scan as ArrayCollection;
> }
> }
> - -
> (sorry for any word wrapping)
>
> Dunno if someone else already suggested this, but I hope this helps.
>
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] 
> 828.271.4289
>
> jch92592 wrote:
> >
> >
> > All,
> >
> > I am using an ArrayCollection that I populate with the results from a
> > ColdFusion RPC.
> >
> > All works well when there is more than 1 record. When only 1 record is
> > returned, the data is not assigned to the ArrayCollection.
> >
> > Any suggestions?
> >
> > Thank you,
> > jh
> >
> >
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJHIiSnvIkv6fg9hYRAlGzAKCIblu06TZ3RwHX0CJg8QqRZrRIXACffhUh
> DnnU2NWQAOl6jhcSwp03gMk=
> =G5aj
> -END PGP SIGNATURE-
>
>
>
>
> --
> Fotis Chatzinikos, Ph.D.
> Founder,
> Phinnovation
> [EMAIL PROTECTED],
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


RE: [flexcoders] ArrayCollection

2008-11-13 Thread Tracy Spratt
Correction:
"The issue is that there is only one "lastResult" for a given RPC Object
instance."
I typically use a single instance for all calls, but not everyone does.
Tracu

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: Thursday, November 13, 2008 6:21 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ArrayCollection

The issue is that there is only one "lastResult" for the entire
framework.
 
"There is only one result" No, this is not correct. Because they are
asynchronous, there can be multiple pending RPC data calls.  There is no
assurance that the first RPC call is the first returned.
 
Between the time the result returns, lastResult is set, the result event
is dispatched, calling your handler, and your handler gets to the line
that uses lastResult, it is very possible that another result has
returned, overwriting the value in lastResult.  Typically it is actually
set to null by the framework, rather than sneaking in some other data,
but that is just as dangerous.  This was a real issue in a thread six or
eight months ago.
 
If you only call a single RPC at a time, there will be no problem, but
complex apps often have many outstanding calls an a given moment.
 
Why take any risk?  Is there some reason you *like* lastResult over
using the event.result object?  
 
Tracy
 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Duncan
Sent: Thursday, November 13, 2008 4:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I am not quite sure by what you mean "...are not garrunteed that it will
have the value in the result you expect." There is only one result. And,
by "dangerous", are you talking about a memory leak or something?

If there is a case when I get no results, then I can understand this
logic, but in my case, there is always at least one result. A single
child within the root element of the returned XML that is.

I appreciate the heads up though.

Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov> 
828.271.4289

Tracy Spratt wrote:
> 
> 
> Mike,
> 
> It is dangerous to use lastResult in this manner:
> 
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> 
> You are not garrunteed that it will have the value in the result you
expect.
> 
> In most cases it will work ok but the correct way is:
> 
> scans = new ArrayCollection([event.result.vector.scan]);
> 
> 
> 
> lastResult is intended only for use in binding expressions.
> 
> 
> 
> Tracy
> 
> 
> 
> --
> 
> *From:* flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
]
> *On Behalf Of *Mike Duncan
> *Sent:* Thursday, November 13, 2008 3:06 PM
> *To:* flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

> *Subject:* Re: [flexcoders] ArrayCollection
> 
> 
> 
> This is how I got around this...
> 
> -
> import mx.uils.ObjectProxy;
> import mx.collections.ArrayCollection;
> 
> [Bindable] private scans:ArrayCollection;
> 
> private function handleGetScansResults(event:ResultEvent):void {
> //Note: getScan is a HTTPService object.
> if(getScan.lastResult.vector.scan is ObjectProxy) {
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> }else{
> scans = getScan.lastResult.vector.scan as ArrayCollection;
> }
> }
> -
> (sorry for any word wrapping)
> 
> Dunno if someone else already suggested this, but I hope this helps.
> 
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov>
<mailto:mike.duncan%40noaa.gov>
> 828.271.4289
> 
> jch92592 wrote:
> 
> 
>> All,
> 
>> I am using an ArrayCollection that I populate with the results from a
>> ColdFusion RPC.
> 
>> All works well when there is more than 1 record. When only 1 record
is
>> returned, the data is not assigned to the ArrayCollection.
> 
>> Any suggestions?
> 
>> Thank you,
>> jh
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFJHJsonvIkv6fg9hYRAi3+AJd4NApCYammCT/86WCi5lPQvChcAJ47p7Zr
YEc4klxZno0I7Je3Se73gw==
=MSe4
-END PGP SIGNATURE-
 


RE: [flexcoders] ArrayCollection

2008-11-13 Thread Tracy Spratt
The issue is that there is only one "lastResult" for the entire
framework.

 

"There is only one result" No, this is not correct. Because they are
asynchronous, there can be multiple pending RPC data calls.  There is no
assurance that the first RPC call is the first returned.

 

Between the time the result returns, lastResult is set, the result event
is dispatched, calling your handler, and your handler gets to the line
that uses lastResult, it is very possible that another result has
returned, overwriting the value in lastResult.  Typically it is actually
set to null by the framework, rather than sneaking in some other data,
but that is just as dangerous.  This was a real issue in a thread six or
eight months ago.

 

If you only call a single RPC at a time, there will be no problem, but
complex apps often have many outstanding calls an a given moment.

 

Why take any risk?  Is there some reason you *like* lastResult over
using the event.result object?  

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Duncan
Sent: Thursday, November 13, 2008 4:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection

 

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I am not quite sure by what you mean "...are not garrunteed that it will
have the value in the result you expect." There is only one result. And,
by "dangerous", are you talking about a memory leak or something?

If there is a case when I get no results, then I can understand this
logic, but in my case, there is always at least one result. A single
child within the root element of the returned XML that is.

I appreciate the heads up though.

Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov> 
828.271.4289

Tracy Spratt wrote:
> 
> 
> Mike,
> 
> It is dangerous to use lastResult in this manner:
> 
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> 
> You are not garrunteed that it will have the value in the result you
expect.
> 
> In most cases it will work ok but the correct way is:
> 
> scans = new ArrayCollection([event.result.vector.scan]);
> 
> 
> 
> lastResult is intended only for use in binding expressions.
> 
> 
> 
> Tracy
> 
> 
> 
> --
> 
> *From:* flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
]
> *On Behalf Of *Mike Duncan
> *Sent:* Thursday, November 13, 2008 3:06 PM
> *To:* flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

> *Subject:* Re: [flexcoders] ArrayCollection
> 
> 
> 
> This is how I got around this...
> 
> -
> import mx.uils.ObjectProxy;
> import mx.collections.ArrayCollection;
> 
> [Bindable] private scans:ArrayCollection;
> 
> private function handleGetScansResults(event:ResultEvent):void {
> //Note: getScan is a HTTPService object.
> if(getScan.lastResult.vector.scan is ObjectProxy) {
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> }else{
> scans = getScan.lastResult.vector.scan as ArrayCollection;
> }
> }
> -
> (sorry for any word wrapping)
> 
> Dunno if someone else already suggested this, but I hope this helps.
> 
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov>
<mailto:mike.duncan%40noaa.gov>
> 828.271.4289
> 
> jch92592 wrote:
> 
> 
>> All,
> 
>> I am using an ArrayCollection that I populate with the results from a
>> ColdFusion RPC.
> 
>> All works well when there is more than 1 record. When only 1 record
is
>> returned, the data is not assigned to the ArrayCollection.
> 
>> Any suggestions?
> 
>> Thank you,
>> jh
> 
> 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
<http://enigmail.mozdev.org> 

iD4DBQFJHJsonvIkv6fg9hYRAi3+AJd4NApCYammCT/86WCi5lPQvChcAJ47p7Zr
YEc4klxZno0I7Je3Se73gw==
=MSe4
-END PGP SIGNATURE-

 



Re: [flexcoders] ArrayCollection

2008-11-13 Thread Fotis Chatzinikos
Mike is that a CF limitation?

On Thu, Nov 13, 2008 at 11:24 PM, Mike Duncan <[EMAIL PROTECTED]> wrote:

>   -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I am not quite sure by what you mean "...are not garrunteed that it will
> have the value in the result you expect." There is only one result. And,
> by "dangerous", are you talking about a memory leak or something?
>
> If there is a case when I get no results, then I can understand this
> logic, but in my case, there is always at least one result. A single
> child within the root element of the returned XML that is.
>
> I appreciate the heads up though.
>
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] 
> 828.271.4289
>
> Tracy Spratt wrote:
> >
> >
> > Mike,
> >
> > It is dangerous to use lastResult in this manner:
> >
> > scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> >
> > You are not garrunteed that it will have the value in the result you
> expect.
> >
> > In most cases it will work ok but the correct way is:
> >
> > scans = new ArrayCollection([event.result.vector.scan]);
> >
> >
> >
> > lastResult is intended only for use in binding expressions.
> >
> >
> >
> > Tracy
> >
> >
> >
> > --------------
> >
> > *From:* flexcoders@yahoogroups.com [mailto:
> flexcoders@yahoogroups.com ]
> > *On Behalf Of *Mike Duncan
> > *Sent:* Thursday, November 13, 2008 3:06 PM
> > *To:* flexcoders@yahoogroups.com 
> > *Subject:* Re: [flexcoders] ArrayCollection
> >
> >
> >
> > This is how I got around this...
> >
> > -
> > import mx.uils.ObjectProxy;
> > import mx.collections.ArrayCollection;
> >
> > [Bindable] private scans:ArrayCollection;
> >
> > private function handleGetScansResults(event:ResultEvent):void {
> > //Note: getScan is a HTTPService object.
> > if(getScan.lastResult.vector.scan is ObjectProxy) {
> > scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> > }else{
> > scans = getScan.lastResult.vector.scan as ArrayCollection;
> > }
> > }
> > -
> > (sorry for any word wrapping)
> >
> > Dunno if someone else already suggested this, but I hope this helps.
> >
> > Mike Duncan
> > ISSO, Application Security Specialist
> > Government Contractor with STG, Inc.
> > NOAA :: National Climatic Data Center
> > 151 Patton Ave.
> > Asheville, NC 28801-5001
> > [EMAIL PROTECTED]   mike.duncan%40noaa.gov >
> > 828.271.4289
> >
> > jch92592 wrote:
> >
> >
> >> All,
> >
> >> I am using an ArrayCollection that I populate with the results from a
> >> ColdFusion RPC.
> >
> >> All works well when there is more than 1 record. When only 1 record is
> >> returned, the data is not assigned to the ArrayCollection.
> >
> >> Any suggestions?
> >
> >> Thank you,
> >> jh
> >
> >
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD4DBQFJHJsonvIkv6fg9hYRAi3+AJd4NApCYammCT/86WCi5lPQvChcAJ47p7Zr
> YEc4klxZno0I7Je3Se73gw==
> =MSe4
> -END PGP SIGNATURE-
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


Re: [flexcoders] ArrayCollection

2008-11-13 Thread Mike Duncan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I am not quite sure by what you mean "...are not garrunteed that it will
have the value in the result you expect." There is only one result. And,
by "dangerous", are you talking about a memory leak or something?

If there is a case when I get no results, then I can understand this
logic, but in my case, there is always at least one result. A single
child within the root element of the returned XML that is.

I appreciate the heads up though.

Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED]
828.271.4289


Tracy Spratt wrote:
> 
> 
> Mike,
> 
> It is dangerous to use lastResult in this manner:
> 
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> 
> You are not garrunteed that it will have the value in the result you expect.
> 
> In most cases it will work ok but the correct way is:
> 
> scans = new ArrayCollection([event.result.vector.scan]);
> 
>  
> 
> lastResult is intended only for use in binding expressions.
> 
>  
> 
> Tracy
> 
>  
> 
> 
> 
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> *On Behalf Of *Mike Duncan
> *Sent:* Thursday, November 13, 2008 3:06 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] ArrayCollection
> 
>  
> 
> This is how I got around this...
> 
> -
> import mx.uils.ObjectProxy;
> import mx.collections.ArrayCollection;
> 
> [Bindable] private scans:ArrayCollection;
> 
> private function handleGetScansResults(event:ResultEvent):void {
> //Note: getScan is a HTTPService object.
> if(getScan.lastResult.vector.scan is ObjectProxy) {
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> }else{
> scans = getScan.lastResult.vector.scan as ArrayCollection;
> }
> }
> -
> (sorry for any word wrapping)
> 
> Dunno if someone else already suggested this, but I hope this helps.
> 
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov>
> 828.271.4289
> 
> jch92592 wrote:
> 
> 
>> All,
> 
>> I am using an ArrayCollection that I populate with the results from a
>> ColdFusion RPC.
> 
>> All works well when there is more than 1 record. When only 1 record is
>> returned, the data is not assigned to the ArrayCollection.
> 
>> Any suggestions?
> 
>> Thank you,
>> jh
> 
> 


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFJHJsonvIkv6fg9hYRAi3+AJd4NApCYammCT/86WCi5lPQvChcAJ47p7Zr
YEc4klxZno0I7Je3Se73gw==
=MSe4
-END PGP SIGNATURE-


RE: [flexcoders] ArrayCollection

2008-11-13 Thread Tracy Spratt
The issue is typically with resultFormat="object", which is the default.
The source of the data is irrelevant.

 

It is a well known issue, search on it for lots of discussion.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Fotis Chatzinikos
Sent: Thursday, November 13, 2008 4:21 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection

 

Sorry is that a problem with Cold Fusion?

I get single element ArrayCollections from by java backend all the time
(I think? :-)

On Thu, Nov 13, 2008 at 11:32 PM, Tracy Spratt <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

Mike, 

It is dangerous to use lastResult in this manner:

scans = new ArrayCollection([getScan.lastResult.vector.scan]);

You are not garrunteed that it will have the value in the result you
expect.

In most cases it will work ok but the correct way is:

scans = new ArrayCollection([event.result.vector.scan]);

 

lastResult is intended only for use in binding expressions.

 

Tracy

 



From: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com>
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> ]
On Behalf Of Mike Duncan
Sent: Thursday, November 13, 2008 3:06 PM
To: flexcoders@yahoogroups.com <mailto:flexcoders@yahoogroups.com> 
Subject: Re: [flexcoders] ArrayCollection

 

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This is how I got around this...

- -
import mx.uils.ObjectProxy;
import mx.collections.ArrayCollection;

[Bindable] private scans:ArrayCollection;

private function handleGetScansResults(event:ResultEvent):void {
//Note: getScan is a HTTPService object.
if(getScan.lastResult.vector.scan is ObjectProxy) {
scans = new ArrayCollection([getScan.lastResult.vector.scan]);
}else{
scans = getScan.lastResult.vector.scan as ArrayCollection;
}
}
- -
(sorry for any word wrapping)

Dunno if someone else already suggested this, but I hope this helps.

Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov> 
828.271.4289

jch92592 wrote:
> 
> 
> All,
> 
> I am using an ArrayCollection that I populate with the results from a
> ColdFusion RPC.
> 
> All works well when there is more than 1 record. When only 1 record is
> returned, the data is not assigned to the ArrayCollection.
> 
> Any suggestions?
> 
> Thank you,
> jh
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
<http://enigmail.mozdev.org> 

iD8DBQFJHIiSnvIkv6fg9hYRAlGzAKCIblu06TZ3RwHX0CJg8QqRZrRIXACffhUh
DnnU2NWQAOl6jhcSwp03gMk=
=G5aj
-END PGP SIGNATURE-




-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> , 

 



Re: [flexcoders] ArrayCollection

2008-11-13 Thread Fotis Chatzinikos
Sorry is that a problem with Cold Fusion?

I get single element ArrayCollections from by java backend all the time (I
think? :-)

On Thu, Nov 13, 2008 at 11:32 PM, Tracy Spratt <[EMAIL PROTECTED]>wrote:

>Mike,
>
> It is dangerous to use lastResult in this manner:
>
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
>
> You are not garrunteed that it will have the value in the result you
> expect.
>
> In most cases it will work ok but the correct way is:
>
> scans = new ArrayCollection([event.result.vector.scan]);
>
>
>
> lastResult is intended only for use in binding expressions.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Mike Duncan
> *Sent:* Thursday, November 13, 2008 3:06 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] ArrayCollection
>
>
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> This is how I got around this...
>
> - -
> import mx.uils.ObjectProxy;
> import mx.collections.ArrayCollection;
>
> [Bindable] private scans:ArrayCollection;
>
> private function handleGetScansResults(event:ResultEvent):void {
> //Note: getScan is a HTTPService object.
> if(getScan.lastResult.vector.scan is ObjectProxy) {
> scans = new ArrayCollection([getScan.lastResult.vector.scan]);
> }else{
> scans = getScan.lastResult.vector.scan as ArrayCollection;
> }
> }
> - -
> (sorry for any word wrapping)
>
> Dunno if someone else already suggested this, but I hope this helps.
>
> Mike Duncan
> ISSO, Application Security Specialist
> Government Contractor with STG, Inc.
> NOAA :: National Climatic Data Center
> 151 Patton Ave.
> Asheville, NC 28801-5001
> [EMAIL PROTECTED] 
> 828.271.4289
>
> jch92592 wrote:
> >
> >
> > All,
> >
> > I am using an ArrayCollection that I populate with the results from a
> > ColdFusion RPC.
> >
> > All works well when there is more than 1 record. When only 1 record is
> > returned, the data is not assigned to the ArrayCollection.
> >
> > Any suggestions?
> >
> > Thank you,
> > jh
> >
> >
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJHIiSnvIkv6fg9hYRAlGzAKCIblu06TZ3RwHX0CJg8QqRZrRIXACffhUh
> DnnU2NWQAOl6jhcSwp03gMk=
> =G5aj
> -END PGP SIGNATURE-
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[EMAIL PROTECTED],


RE: [flexcoders] ArrayCollection

2008-11-13 Thread Tracy Spratt
Mike, 

It is dangerous to use lastResult in this manner:

scans = new ArrayCollection([getScan.lastResult.vector.scan]);

You are not garrunteed that it will have the value in the result you
expect.

In most cases it will work ok but the correct way is:

scans = new ArrayCollection([event.result.vector.scan]);

 

lastResult is intended only for use in binding expressions.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mike Duncan
Sent: Thursday, November 13, 2008 3:06 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection

 

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This is how I got around this...

- -
import mx.uils.ObjectProxy;
import mx.collections.ArrayCollection;

[Bindable] private scans:ArrayCollection;

private function handleGetScansResults(event:ResultEvent):void {
//Note: getScan is a HTTPService object.
if(getScan.lastResult.vector.scan is ObjectProxy) {
scans = new ArrayCollection([getScan.lastResult.vector.scan]);
}else{
scans = getScan.lastResult.vector.scan as ArrayCollection;
}
}
- -
(sorry for any word wrapping)

Dunno if someone else already suggested this, but I hope this helps.

Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED] <mailto:mike.duncan%40noaa.gov> 
828.271.4289

jch92592 wrote:
> 
> 
> All,
> 
> I am using an ArrayCollection that I populate with the results from a
> ColdFusion RPC.
> 
> All works well when there is more than 1 record. When only 1 record is
> returned, the data is not assigned to the ArrayCollection.
> 
> Any suggestions?
> 
> Thank you,
> jh
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
<http://enigmail.mozdev.org> 

iD8DBQFJHIiSnvIkv6fg9hYRAlGzAKCIblu06TZ3RwHX0CJg8QqRZrRIXACffhUh
DnnU2NWQAOl6jhcSwp03gMk=
=G5aj
-END PGP SIGNATURE-

 



Re: [flexcoders] ArrayCollection

2008-11-13 Thread Mike Duncan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


This is how I got around this...

- -
import mx.uils.ObjectProxy;
import mx.collections.ArrayCollection;

[Bindable] private scans:ArrayCollection;

private function handleGetScansResults(event:ResultEvent):void  {
  //Note: getScan is a HTTPService object.
  if(getScan.lastResult.vector.scan is ObjectProxy)  {
scans = new ArrayCollection([getScan.lastResult.vector.scan]);
  }else{
scans = getScan.lastResult.vector.scan as ArrayCollection;
  }
}
- -
(sorry for any word wrapping)

Dunno if someone else already suggested this, but I hope this helps.

Mike Duncan
ISSO, Application Security Specialist
Government Contractor with STG, Inc.
NOAA :: National Climatic Data Center
151 Patton Ave.
Asheville, NC 28801-5001
[EMAIL PROTECTED]
828.271.4289


jch92592 wrote:
> 
> 
> All,
> 
> I am using an ArrayCollection that I populate with the results from a
> ColdFusion RPC.
> 
> All works well when there is more than 1 record. When only 1 record is
> returned, the data is not assigned to the ArrayCollection.
> 
> Any suggestions?
> 
> Thank you,
> jh
> 
> 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJHIiSnvIkv6fg9hYRAlGzAKCIblu06TZ3RwHX0CJg8QqRZrRIXACffhUh
DnnU2NWQAOl6jhcSwp03gMk=
=G5aj
-END PGP SIGNATURE-


RE: [flexcoders] ArrayCollection

2008-11-13 Thread Tracy Spratt
A well known issue.  The FP is unable to differentiate between an Object
and an Array with a single element.

 

I use XML until I have full control, so I don't see this issue.

 

You can examine the result object to see what it really contains and
respond conditionally, or you can use toArray(), which is in one of the
Utils packages.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jch92592
Sent: Thursday, November 13, 2008 2:18 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection

 

All,

I am using an ArrayCollection that I populate with the results from a
ColdFusion RPC.

All works well when there is more than 1 record. When only 1 record is
returned, the data is not assigned to the ArrayCollection.

Any suggestions?

Thank you,
jh

 



Re: [flexcoders] ArrayCollection bound to an Array.

2008-08-26 Thread Sefi Ninio
You could bind a setter, something like this (written in gmail, this was not
compiled):

private var array:Array;
private var arrayCollection:ArrayCollection;

public function ClassName(..args) { //Constructor
   array = new Array();
   BindingUtils.bindSetter(setArrayCollection, this, array);
}

private function setArrayCollection(array:Array):void {
   arrayCollection = new ArrayCollection(array);
}

This will cause the setter function to run everytime array changes. But do
some reading on when Array does and does not dispatch a change event...

HTH
Sefi


On Tue, Aug 26, 2008 at 7:58 PM, Battershall, Jeff <
[EMAIL PROTECTED]> wrote:

>   Your approach to the problem doesn't appear to be correct. Some
> additional code would be helpful.
>
> Jeff
>
>
> -Original Message-
> From: flexcoders@yahoogroups.com  [mailto:
> flexcoders@yahoogroups.com ] On
> Behalf Of flexaustin
> Sent: Tuesday, August 26, 2008 11:17 AM
> To: flexcoders@yahoogroups.com 
> Subject: [flexcoders] ArrayCollection bound to an Array.
>
> Is it possible to bind an ArrayCOllection to an array, like so
>
> public var summDataForControllers:Array = new Array;
>
> public var _summDataForContrAC:ArrayCollection = new
> ArrayCollection({summDataForControllers});
>
> I have a modelLocator that contains these to items (above) and I want a
> component to bind to the arrayCollection. I am storing the information
> in the array first because when I try to update the arraycollection from
> my component and then access a certain item in the arraycollection I get
> Index 0 out of bounds. So in other words I iterate and say
> arrayCollection.addItemAt(i) then try
> arrayCOllection.getItemAt(i) I get the out of bounds issue.
>
> But if I iterate and store the information in an array everything is
> fine, but now my component can't listen for updates, which is the reason
> I am trying to bind my arraycollection to the array.
>
> Thanks in advance for any help.
>
> 
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> Links
>
>  
>


RE: [flexcoders] ArrayCollection bound to an Array.

2008-08-26 Thread Battershall, Jeff
Your approach to the problem doesn't appear to be correct. Some
additional code would be helpful.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of flexaustin
Sent: Tuesday, August 26, 2008 11:17 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection bound to an Array.


Is it possible to bind an ArrayCOllection to an array, like so

public var summDataForControllers:Array = new Array;

public var _summDataForContrAC:ArrayCollection = new
ArrayCollection({summDataForControllers});

I have a modelLocator that contains these to items (above) and I want a
component to bind to the arrayCollection.  I am storing the information
in the array first because when I try to update the arraycollection from
my component and then access a certain item in the arraycollection I get
Index 0 out of bounds. So in other words I iterate and say
arrayCollection.addItemAt(i) then try
arrayCOllection.getItemAt(i) I get the out of bounds issue.

But if I iterate and store the information in an array everything is
fine, but now my component can't listen for updates, which is the reason
I am trying to bind my arraycollection to the array.

Thanks in advance for any help.






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





RE: [flexcoders] ArrayCollection ChangeEvent does noget get dispatched when filterFunction is set

2008-07-26 Thread Alex Harui
AC is a view of the data so if an item changes that is not in the
current view (filtered out) I don't think it should send an event

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of dopenhagen
Sent: Saturday, July 26, 2008 4:09 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection ChangeEvent does noget get
dispatched when filterFunction is set

 

It appears that an arraycollection's changeEvent
(CollectionEvent.COLLECTION_CHANGE) does not get called correctly when
FilterFunction is set.
Is anyone else experiencing this behavior, and if yes: is it a feature
or a bug ?

 



Re: [flexcoders] ArrayCollection filterFunction only gets called on root item

2008-07-22 Thread Scott Bachman
The filterFunction only applies to the ArrayCollection. By hierarchy, I
assume you mean you have an ArrayCollection that contains ArrayCollections.
In other words, objects in your original ArrayCollection have, say, a
children ArrayCollection. In order to do what you're describing, you would
have to set the filterFunction on each of these child's filterFunction and
each of there's, etc.

In the past, I have done something like this to achieve what you're talking
about:

public function filterMenuItems(filter:IMenuFilter):void {
if (children) {
// need to clear all filters first, otherwise hidden higher
levels won't come back
children.filterFunction = null;
children.refresh();
for (var i:int=0; i < children.length; i++) {
if (children.getItemAt(i) is Menu) {
Menu(children.getItemAt(i)).filterMenuItems(filter);
}
}
children.filterFunction = filter.menuItemFilter;
children.refresh();
}
}

Here, a Menu is filtered by calling it's filterMenuItems method with a
filter object, traversing down through other Menu's children (via the
recursive call) setting the filterFunction.

Scott

On Mon, Jul 21, 2008 at 5:55 PM, Greg Hess <[EMAIL PROTECTED]> wrote:

>   Hi All,
>
> I have a tree control who's data provider is an ArrayCollection
> holding a single File object I defined. The File object represents the
> root of a remote file system hierarchy that has children getter that
> supports the tree control and each child is rendered in the tree with
> an ItemRenderer.
>
> The tree control displays the File hierarchy well and it traverses the
> data providers children as expected. However, filter does not. I
> wanted to apply a filter to the data provider so only directory items
> are displayed. I specified the filterFunction and refresh the
> dataProvider but it only gets called on the first root node and not
> the data model hierarchy and each item that gets rendered in the tree.
>
> Should I have implemented a special interface so the tree or data
> provider can properly filter the object hierarchy?
>
> What am I doing wrong?
>
> Any help much appreciated.
>
> -Greg
>  
>


Re: [flexcoders] arrayCollection event COLLECTION_CHANGE issues?

2008-07-17 Thread Scott
Let me correct that last statement...

 

I do -not- see the acUser in the control-space selection items.  I see
the original named variable and other functions but I also see some
functions that no longer exist.  Why isn't Flex updating that list?

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott
Sent: Thursday, July 17, 2008 5:24 PM
To: flexcoders@yahoogroups.com
Subject: {Disarmed} Re: [flexcoders] arrayCollection event
COLLECTION_CHANGE issues?

 

When I do that I get an error that the property is not defined.  I can
do the control space and see that FB is seeing all of the items along
the path of GlobalVars.instance.acUser.source but the instant I save it
the error "access of possibly undefined property accuser through a
reference with static type com.cfgenerated.models.GlobalVars.

 

This is my .as singleton class:

  public class GlobalVars

  {

private static var classInstance:GlobalVars = null;

private static var constructorLocked:Boolean = true;



public var objUser:Object = new Object();



public function GlobalVars()

{

  if( constructorLocked )

  {

throw new Error( "Cannot open another instance
of GVs" );

  }

}

public static function get instance():GlobalVars

{

  if( classInstance == null )

  {

constructorLocked = false;

classInstance = new GlobalVars();

constructorLocked = true;

  }

  return classInstance;

}

}

 

And this is my call to create the singleton instance:

[Bindable] public var acUser:ArrayCollection = new ArrayCollection();

 

Any ideas?

 

 Thanks

  sj

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel Gold
Sent: Thursday, July 17, 2008 8:45 AM
To: flexcoders@yahoogroups.com
Subject: {Disarmed} Re: [flexcoders] arrayCollection event
COLLECTION_CHANGE issues?

 

You're initializing the acUser collection when the singleton is created
and adding a listener, which is fine. However, when you're getting the
results back, you're changing the acUser collection reference to a
different ArrayCollection

GlobalVars.instance.acUser = event.result as ArrayCollection;

So your singleton still has a listener registered on the original
ArrayCollection, but your singleton model now contains a reference to
the new ArrayCollection returned from the service. To keep your
references pointing to the same ArrayCollection and still get the
COLLECTION_CHANGE, you could play games like this:

GlobalVars.instance.acUser.source =
ArrayCollection(event.result).source;
GlobalVars.instance.acUser.refresh();

In that you're swapping out the underlying Array the collection is
wrapped around, and then calling refresh will dispatch teh
COLLECTION_CHANGE, firing any bindings and calling your listener code.

On Thu, Jul 17, 2008 at 8:43 AM, Scott <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

First thanks for all your help guys.  I'm making nice strides learning
this language quickly.

 

I'm working with events now.  I created an arrayCollection to capture a
query from coldfusion.  I have the data being dumped into this variable
just fine (I can do a combobox on it and see all of it).  Now what I
want to do is set some variables based on these items.  I created an
event to watch the arrayCollection which would run a function to reset
the variables automatically.  Here's what I did:

 

 

This is all within a singleton class...

 

Created the [Bindable]acUser array collection

[Bindable] public var acUser:ArrayCollection = new ArrayCollection();

 

Created an init() function to set up the event handler:

  private function init():void

  { 

  acUser.addEventListener(CollectionEvent.COLLECTION_CHANGE,
acUser_collectionChange);

  }

 

Created a function to set the variables if the event hit:

  private function
acUser_collectionChange(event:CollectionEvent):void

  { 

strEMail =
ObjectUtil.toString(acUser.getItemAt(0).strEMail);   (not sure if this
call is correct -yet-)

trace(strEMail);

  }

 

Modified the header for the page to run the init() function

http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "

  creationComplete="init()"

  xmlns="*"

  xmlns:controllers="com.cfgenerated.controllers.*"

xmlns:login="com.cfgenerated.views.login.*"

  layout="absolute"

  currentState="NotLoggedIn">

 

 

This should be all I need to do, right?

 

When I push the d

Re: [flexcoders] arrayCollection event COLLECTION_CHANGE issues?

2008-07-17 Thread Scott
When I do that I get an error that the property is not defined.  I can
do the control space and see that FB is seeing all of the items along
the path of GlobalVars.instance.acUser.source but the instant I save it
the error "access of possibly undefined property accuser through a
reference with static type com.cfgenerated.models.GlobalVars.

 

This is my .as singleton class:

  public class GlobalVars

  {

private static var classInstance:GlobalVars = null;

private static var constructorLocked:Boolean = true;



public var objUser:Object = new Object();



public function GlobalVars()

{

  if( constructorLocked )

  {

throw new Error( "Cannot open another instance
of GVs" );

  }

}

public static function get instance():GlobalVars

{

  if( classInstance == null )

  {

constructorLocked = false;

classInstance = new GlobalVars();

constructorLocked = true;

  }

  return classInstance;

}

}

 

And this is my call to create the singleton instance:

[Bindable] public var acUser:ArrayCollection = new ArrayCollection();

 

Any ideas?

 

 Thanks

  sj

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel Gold
Sent: Thursday, July 17, 2008 8:45 AM
To: flexcoders@yahoogroups.com
Subject: {Disarmed} Re: [flexcoders] arrayCollection event
COLLECTION_CHANGE issues?

 

You're initializing the acUser collection when the singleton is created
and adding a listener, which is fine. However, when you're getting the
results back, you're changing the acUser collection reference to a
different ArrayCollection

GlobalVars.instance.acUser = event.result as ArrayCollection;

So your singleton still has a listener registered on the original
ArrayCollection, but your singleton model now contains a reference to
the new ArrayCollection returned from the service. To keep your
references pointing to the same ArrayCollection and still get the
COLLECTION_CHANGE, you could play games like this:

GlobalVars.instance.acUser.source =
ArrayCollection(event.result).source;
GlobalVars.instance.acUser.refresh();

In that you're swapping out the underlying Array the collection is
wrapped around, and then calling refresh will dispatch teh
COLLECTION_CHANGE, firing any bindings and calling your listener code.

On Thu, Jul 17, 2008 at 8:43 AM, Scott <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:

First thanks for all your help guys.  I'm making nice strides learning
this language quickly.

 

I'm working with events now.  I created an arrayCollection to capture a
query from coldfusion.  I have the data being dumped into this variable
just fine (I can do a combobox on it and see all of it).  Now what I
want to do is set some variables based on these items.  I created an
event to watch the arrayCollection which would run a function to reset
the variables automatically.  Here's what I did:

 

 

This is all within a singleton class...

 

Created the [Bindable]acUser array collection

[Bindable] public var acUser:ArrayCollection = new ArrayCollection();

 

Created an init() function to set up the event handler:

  private function init():void

  { 

  acUser.addEventListener(CollectionEvent.COLLECTION_CHANGE,
acUser_collectionChange);

  }

 

Created a function to set the variables if the event hit:

  private function
acUser_collectionChange(event:CollectionEvent):void

  { 

strEMail =
ObjectUtil.toString(acUser.getItemAt(0).strEMail);   (not sure if this
call is correct -yet-)

trace(strEMail);

  }

 

Modified the header for the page to run the init() function

http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "

  creationComplete="init()"

  xmlns="*"

  xmlns:controllers="com.cfgenerated.controllers.*"

xmlns:login="com.cfgenerated.views.login.*"

  layout="absolute"

  currentState="NotLoggedIn">

 

 

This should be all I need to do, right?

 

When I push the data into the singleton:

 

GlobalVars.instance.acUser = event.result as ArrayCollection;

 

The event does not fire.  Any ideas?

 

 

TIA!

 

 


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 


Re: [flexcoders] arrayCollection event COLLECTION_CHANGE issues?

2008-07-17 Thread Daniel Gold
You're initializing the acUser collection when the singleton is created and
adding a listener, which is fine. However, when you're getting the results
back, you're changing the acUser collection reference to a different
ArrayCollection

GlobalVars.instance.acUser = event.result as ArrayCollection;

So your singleton still has a listener registered on the original
ArrayCollection, but your singleton model now contains a reference to the
new ArrayCollection returned from the service. To keep your references
pointing to the same ArrayCollection and still get the COLLECTION_CHANGE,
you could play games like this:

GlobalVars.instance.acUser.source = ArrayCollection(event.result).source;
GlobalVars.instance.acUser.refresh();

In that you're swapping out the underlying Array the collection is wrapped
around, and then calling refresh will dispatch teh COLLECTION_CHANGE, firing
any bindings and calling your listener code.

On Thu, Jul 17, 2008 at 8:43 AM, Scott <[EMAIL PROTECTED]> wrote:

>First thanks for all your help guys.  I'm making nice strides learning
> this language quickly.
>
>
>
> I'm working with events now.  I created an arrayCollection to capture a
> query from coldfusion.  I have the data being dumped into this variable just
> fine (I can do a combobox on it and see all of it).  Now what I want to do
> is set some variables based on these items.  I created an event to watch the
> arrayCollection which would run a function to reset the variables
> automatically.  Here's what I did:
>
>
>
>
>
> This is all within a singleton class…
>
>
>
> Created the [Bindable]acUser array collection
>
> [Bindable] public var acUser:ArrayCollection = new ArrayCollection();
>
>
>
> Created an init() function to set up the event handler:
>
>   *private* *function* init():*void*
>
>   {
>
>   acUser.addEventListener(CollectionEvent.COLLECTION_CHANGE,
> acUser_collectionChange);
>
>   }
>
>
>
> Created a function to set the variables if the event hit:
>
>   *private* *function* acUser_collectionChange(event:CollectionEvent):
> *void*
>
>   {
>
> strEMail = ObjectUtil.toString(acUser.getItemAt(0).strEMail);
> (not sure if this call is correct –yet-)
>
> *trace*(strEMail);
>
>   }
>
>
>
> Modified the header for the page to run the init() function
>
> http://www.adobe.com/2006/mxml";
>
>   creationComplete="init()"
>
>   xmlns="*"
>
>   xmlns:controllers="com.cfgenerated.controllers.*"
>
> xmlns:login="com.cfgenerated.views.login.*"
>
>   layout="absolute"
>
>   currentState="NotLoggedIn">
>
>
>
>
>
> This should be all I need to do, right?
>
>
>
> When I push the data into the singleton:
>
>
>
> GlobalVars.instance.acUser = event.result as ArrayCollection;
>
>
>
> The event does not fire.  Any ideas?
>
>
>
>
>
> TIA!
>  
>


Re: [flexcoders] ArrayCollection (AS) and ArrayList (java) not in sync)

2008-04-23 Thread Luke Vanderfluit
Hi.

As always. On further inspection the array on the server isnt getting it right.
Sorry for the noise )-:

Kr.
L.

Luke Vanderfluit wrote:
> Hi.
> 
> Im having a problem retrieving a list of objects from the server.
> Im using blazeds and have successfully retrieved lists of objects using the 
> following construct:
> 
> Im dealing with a list that has Site Objects
> 
> 
> 
> 
> On the server the ArrayList is being generated correctly with 2 different 
> Site 
> objects. On the client side Im getting the last of the 2 sites twice.
> So I iterate through the ArrayCollection and there are 2 same Objects in 
> there.
> 
> Odd...
> 
> Any suggestions would be welcome.
> 
> Kind regards.
> Luke.
> 


-- 
Luke Vanderfluit
Analyst / Web Programmer
e3Learning.com.au
08 8221 6422


Re: [flexcoders] arraycollection and tree

2008-03-25 Thread Nayan Savla

Hi Luke,

Just create a List in Java and return it. alternatively you can add it  
to a Value Object and then return it. below is example of my function,  
CategoriesVo is simple java class with three public variables.


public List getCategoriesAll(){
List list = new ArrayList();

		String query = "SELECT main.id, main.name, sub.name FROM  
maincategories AS main, subcategories AS sub WHERE main.id =  
sub.maincategoryId";

//String query = "SELECT * FROM maincategories";

try {
ResultSet results = 
connManager.stmt.executeQuery(query);
//results.first();

String secondKey = "";
String firstKey = "";

Integer categoryId;
while (results.next()){
CategoriesVo categories = new CategoriesVo();
firstKey = results.getString(2);
categoryId = results.getInt(1);
secondKey = results.getString(3);

categories.mainCategory = secondKey;
categories.subCategories = firstKey;

categories.categoryId = prevCategory;

list.add(categories);
// hashMap.put(secondKey, list);
// System.out.println("adding to the hashmap 
" + secondKey);

}
} catch (SQLException e){   
}   

return list;
}


this can be cast to arraycollection in Flex or you can loop through  
the result and add it to a collection.


hope this helps.

Nayan


On Mar 24, 2008, at 10:57 PM, Luke Vanderfluit wrote:


Hi.

I am using remoteobject to get stuff from a database (java/mysql). I
want to represent the List, generated on the server side and sent to  
the

client as an arraycollection, as a tree.

Does anyone have examples of how to do this.
I have been reading the online docs but Im making very slow progress.

Thanks.
Kind regards.
Luke.






RE: [flexcoders] ArrayCollection of String as single-column DataGrid provider

2008-03-21 Thread Alex Harui
You cannot use simple types (String, Number) in a DG.  You have to use
objects like:

 



 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of mario.blataric
Sent: Friday, March 21, 2008 4:00 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection of String as single-column
DataGrid provider

 

Hi!

I have ArrayCollection filled with String:

String 1
String 2



DataGrid's dataProvider is array collection above and DataGrid has
only one column.

What I want is to have ComboBox as inplace ItemRenderer/Editor, but I
don't know what to set in DataGridColumn's dataField property since
ArrayCollection contains String and not Object. 

Something like this:





  





Any ideas how to do this?

Thanks,

Mario B. 

 



RE: [flexcoders] ArrayCollection refresh event listener

2008-03-21 Thread Alex Harui
CollectionEvent.CHANGE with CollectionEventKind.REFRESH

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of loc_tran106
Sent: Friday, March 21, 2008 10:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection refresh event listener

 

I wanted to do some custom calculations on the filtered data of an
arraycollection.

I set the filterfunction for the ac, and then called ac.refresh(). 
What is the proper event to listen for so I can handle my calculations
when the refresh on is complete?

Thanks,

-Loc

 



Re: [flexcoders] ArrayCollection question in Cairngorm?

2007-12-17 Thread Mark Shen
Thanks João Fernandes .

Mark


- Original Message 
From: João Fernandes <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Monday, December 17, 2007 1:28:20 PM
Subject: Re: [flexcoders] ArrayCollection question in Cairngorm?

Mark, your result is just fine, just define a labelField or a 
labelFunction in your combobox.
something like this



-- 

João Fernandes

http://www.onflexwi thcf.org
http://www.riapt. org





  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

Re: [flexcoders] ArrayCollection question in Cairngorm?

2007-12-17 Thread João Fernandes
Mark, your result is just fine, just define a labelField or a 
labelFunction in your combobox.
something like this



-- 

João Fernandes

http://www.onflexwithcf.org
http://www.riapt.org



Re: [flexcoders] ArrayCollection question in Cairngorm?

2007-12-17 Thread Sanjay Varma
None

- Original Message 
From: markflex2007 <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Monday, December 17, 2007 12:22:59 PM
Subject: [flexcoders] ArrayCollection question   in Cairngorm?










  



Hi,



I have a simple cfc, the function is like this,it get a department 

list









 SELECT Id, Dept 

 FROM tlkpDept

 

 

 



   



2.This is the modellocator .I want to save department list to the 

acDept (ArrayCollection)



public class  BursaryModel implements IModelLocator {



 

private static var instance:CESFBursar yModel;

   

...

public var acDept : ArrayCollection;



...

}





3.This is the Delegate function. this  builds a flex function getDept

()



public function getDept():void {

 

var call:Object = this.service. getDept() ;

call.addResponder( responder) ;

 

}





4.This is part of the command class 



public function result( event:Object ):void {

 

...

 modelLocator. acDept = event.result;

  ...

 

 

}



5 the view page, bind the 



...

private var modelLocator: BursaryModel = 

CESFBursaryModel. getInstance( );

...



 





my error is I get a list and it looks like.



[object Object]

[object Object]

[object Object]

[object Object]



but I want to show the dapartment list,Please help me and give me a 

hit how to fix this.

 

 I do not know what the event.result is command class and how to 

convert is to a real department list.

 

 

 Thanks for your help

 

 

 Mark






  























RE: [flexcoders] ArrayCollection Question

2007-10-27 Thread Alex Harui
You can use ICollectionView, but you'll probably find the IList methods
easier (addItem).

 

Those methods will change the array that is the source of the AC.

 

Re-ordering should require that dragMoveEnabled=true.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Forsberg
Sent: Friday, October 26, 2007 6:30 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection Question

 

I am dragging/dropping rows from one grid to another. At the drop I 
will be calling a .cfc to get more information for the second 
datagrid.
I have several questions about the data that I'm adding.

1. To add the data "manually" after I've captured my drop event do I 
need to use the Icollection? class to put the data into the datagrid?

2. If in-fact I'm using the Icollection class, when I add the data is 
that change being made in the arrayCollection? The reason that I ask 
is that once changes are made to the data, either by the automatic 
insert, or if a user edits a cell, can I then loop over the 
arrayCollection to insert the changes back into the database?

If anyone has any links about doing this I'd be grateful.

Also, my second datagrid is both drop and drag enabled. I want 
users to be able to re-order the items in the datagrid as well as 
add/edit items. This is a scheduling application. I'll then save 
those changes to the db.
I noticed that when I went to re-order items in the second 
datagrid I actually made a copy in the new location. The old row 
remained. Is there a special way to make sure that once I've made the 
move the old row is removed?

I really appreciate the pointing in the right direction. Flex 2 is 
really slick. I'm just running into some newb wall.

Again, thanks.

Mark F.



 



RE: [flexcoders] ArrayCollection XMLList?

2007-10-05 Thread Tracy Spratt
Maybe someone will point to a simple custom ItreeDataDescriptor example.


 

It might be easier to convert the AC to xml.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Friday, October 05, 2007 3:29 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] ArrayCollection XMLList?

 

Whether the objects are strongly-typed or not, you can stick the AC in
as the Tree's DP, but you'll need a custom ITreeDataDescriptor to tell
the tree what is a branch and what the children are.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott - FastLane
Sent: Friday, October 05, 2007 12:01 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection XMLList?

 

Assuming your ArrayCollection contains strongly typed objects, I think
you can make the ArrayCollection itself be the dataprovider for your
tree.  Your class (the data stored in the ArrayCollection) just needs to
implement the get children():Array and get label():String method iirc.

hth
Scott

candysmate wrote: 

I have an ArrayCollection in Flex which contains the delivery
information for a given stock item:

boxes quantity

10 20
15 20
17 20

etc 

how can I convert this into an XMLList so that it can be a
dataProvider for a tree control where each line is a branch of
the
tree please?

 

 



RE: [flexcoders] ArrayCollection XMLList?

2007-10-05 Thread Alex Harui
Whether the objects are strongly-typed or not, you can stick the AC in
as the Tree's DP, but you'll need a custom ITreeDataDescriptor to tell
the tree what is a branch and what the children are.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Scott - FastLane
Sent: Friday, October 05, 2007 12:01 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection XMLList?

 

Assuming your ArrayCollection contains strongly typed objects, I think
you can make the ArrayCollection itself be the dataprovider for your
tree.  Your class (the data stored in the ArrayCollection) just needs to
implement the get children():Array and get label():String method iirc.

hth
Scott

candysmate wrote: 

I have an ArrayCollection in Flex which contains the delivery
information for a given stock item:

boxes quantity

10 20
15 20
17 20

etc 

how can I convert this into an XMLList so that it can be a
dataProvider for a tree control where each line is a branch of
the
tree please?

 

 



Re: [flexcoders] ArrayCollection XMLList?

2007-10-05 Thread Scott - FastLane
Assuming your ArrayCollection contains strongly typed objects, I think 
you can make the ArrayCollection itself be the dataprovider for your 
tree.  Your class (the data stored in the ArrayCollection) just needs to 
implement the get children():Array and get label():String method iirc.


hth
Scott

candysmate wrote:


I have an ArrayCollection in Flex which contains the delivery
information for a given stock item:

boxes quantity

10 20
15 20
17 20

etc 

how can I convert this into an XMLList so that it can be a
dataProvider for a tree control where each line is a branch of the
tree please?

 




RE: [flexcoders] arraycollection contains() method

2007-10-02 Thread Alex Harui
Each time you use {} you create a different object, so the two
collections have different objects with the same data.  Contains just
sees if the reference to an object is in the collection and doesn't
investigate internal properties.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of freska
Sent: Monday, October 01, 2007 11:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] arraycollection contains() method



Hi there,
I want to compare two arraycollection and take the different items
out. I tried using contains() method to check if the first item of
arraycollection arrayControl is in arraycollection arrayColPref, but
it just doesn't work. I mean, it is supposed to say "True" instead of
"False". So, here's my code. Please show me where I did it wrong.

[Bindable]
public var arrayControl:ArrayCollection = new
ArrayCollection([{name:"Message", data:"colMessage"}, {name:"Assigned
to", data:"colAssignedto"}, {name:"Start date", data:"colStartdate"},
{name:"Due date", data:"colDuedate"}, {name:"Status",
data:"colStatus"}, {name:"Priority", data:"colPriority"},
{name:"Posted by", data:"colPostedby"}]);

[Bindable]
public var arrayColPref:ArrayCollection = new
ArrayCollection([{name:"Message", data:"colMessage"},
{name:"Priority", data:"colPriority"}, {name:"Assigned to",
data:"colAssignedto"}, {name:"Status", data:"colStatus"}]);

public function isDuplicate():void {
var bool:Boolean = arrayColPref.contains(arrayControl.getItemAt(0));
Alert.show(String(bool));
}



 


Re: [flexcoders] ArrayCollection not working? Pulling out my HAIR!!!

2007-06-06 Thread Brendan Meutzner

Any reason you're going through the trouble of converting to an
ArrayCollection?  The following will work with your XML data just fine...


   
   
   
   
   
   
   
   
   


Brendan



On 6/6/07, Jason Ervin <[EMAIL PROTECTED]> wrote:


  Hey everyone I am having issues with using an arraycollection as a
dataprovider. I start with an xml variable (see below) then I convert
it to an ArrayCollection using ArrayUtil.toArray and I use the result
as a dataprovider. If I trace the dataprovider it prints out the xml
data, but my chart is empty. Can you use ArrayUtil on xml data with
this many nodes? I have spent way to much time on this.

Here is what I have starting with my XML file.

XML CODE START

public var billData:XML =


May-05
true
60.00
45.00
15.00
120.00
500
71.4
200
18.00
9.00
2.00
29.00
4.00
2.00
1.00
7.00
2.00
1.00
.50
3.50
0.00
33
5/01/2007
155.00
manual
152868


Apr-05
true
88.88
50.00
15.00
115.00
300
62.9
189
15.00
6.00
3.00
24.00
4.50
2.50
1.25
8.25
2.10
1.90
.50
4.50
0.00
28
3/29/2007
155.00
amr
150008


Mar-05
true
62.00
45.10
10.00
118.10
300
50.4
210
13.00
7.00
1.00
21.00
5.00
2.20
1.10
8.30
2.20
1.70
.50
4.40
[EMAIL PROTECTED] 
0.00
30
3/01/2007
155.00
manual
146968


/* starting another xml document */

/* public var billData2:XML =



true
60.00
45.00
15.00
120.00
500
71.4
200
18.00
9.00
2.00
29.00
4.00
2.00
1.00
7.00
2.00
1.00
.50
3.50
0.00
33
5/01/2007
155.00
manual
152868


true
50.44
23.77
15.12
115.11
300
62.9
189
15.00
6.00
3.00
24.00
4.50
2.50
1.25
8.25
2.10
1.90
.52
4.50
0.00
28
3/29/2007
155.00
amr
150008


true
62.00
45.10
10.00
118.10
300
50.4
210
13.00
7.00
1.00
21.00
5.00
2.20
1.10
8.30
2.20
1.70
.50
4.40
[EMAIL PROTECTED] 
0.00
30
3/01/2007
155.00
manual
146968




true
12.34
45.00
15.00
120.00
500
71.4
200
18.00
9.00
2.00
29.00
4.00
2.00
1.00
7.00
2.00
1.00
.50
3.50
0.00
33
5/01/2007
155.00
manual
152868


true
44.44
23.77
15.12
115.11
300
62.9
189
15.00
6.00
3.00
24.00
4.50
2.50
1.25
8.25
2.10
1.90
.52
4.50
0.00
28
3/29/2007
155.00
amr
150008


true
62.00
45.10
10.00
118.10
300
50.4
210
13.00
7.00
1.00
21.00
5.00
2.20
1.10
8.30
2.20
1.70
.50
4.40
[EMAIL PROTECTED] 
0.00
30
3/01/2007
155.00
manual
146968


 */
/* private var billDataXMLList:XMLList = new XMLList(billData); */
public var billXML:XML = new XML(billData);
public var billDataAC:XMLListCollection = new
XMLListCollection(billData.bill);
public var accountDataAC:XMLListCollection = new
XMLListCollection([EMAIL PROTECTED]);
/* public var billDataLC:XMLListCollection = new
XMLListCollection(billData2.account[0].month); */
public var billDataAC2:ArrayCollection = new
ArrayCollection(ArrayUtil.toArray(billXML.bill));

HERE IS HOW I AM USING IT












 





--
Brendan Meutzner
Stretch Media - RIA Adobe Flex Development
[EMAIL PROTECTED]
http://www.stretchmedia.ca


Re: [flexcoders] ArrayCollection problem (binding to a Datagrid)

2007-03-25 Thread leds usop
this has been addressed in a previous post.
do a type check for objectproxy before assigning here:

grilleTerrainsACDP = event.result.terrains.terrain;

to have this:

if(event.result.terrains.terrain is ObjectProxy){
var t:Array=
ArrayUtil.toArray(event.result.terrains.terrain);
grilleTerrainsACDP= new ArrayCollection(t);
}else{
grilleTerrainsACDP = event.result.terrains.terrain;
}




--- Nicolas Boulet-Lavoie
<[EMAIL PROTECTED]> wrote:

> Hi,
> 
> When I try to bind an empty ArrayCollection or with
> only 1 item to a
> Datagrid, I'm getting a runtime error (sorry it's in
> french but the
> error number means something in this case):
> 
> TypeError: Error #1034: Echec de la contrainte de
> type : conversion de
> mx.utils::[EMAIL PROTECTED] en
> mx.collections.ArrayCollection
> impossible.
> 
> Here's the code I use :
> 
> private function handler(event:ResultEvent):void {
>grilleTerrainsACDP =
> event.result.terrains.terrain;
> }
> 
> And the "grilleTerrainsACDP" variable who's binded
> to my datagrid, as
> the data provider, is declared this way:
> 
> [Bindable] public var
> grilleTerrainsACDP:ArrayCollection;
> 
> Any idea?
> 
> I use a ArrayCollection for ICursorView...
> 
> Thanks
> Nicolas
> 
> 



 

Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/


RE: [flexcoders] ArrayCollection problem (binding to a Datagrid)

2007-03-23 Thread Alex Harui
When data is sent over the wire from a server, we have to guess whether
it is a single data object or an array of objects.  If we see an xml tag
twice we know it has to be an array, but if there is only one tag, we
assume it is an object.

 

You can simply test to see if the result is an ObjectProxy or an
Array/ArrayCollection and convert it to an array if needed.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Nicolas Boulet-Lavoie
Sent: Friday, March 23, 2007 11:04 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection problem (binding to a Datagrid)

 

Hi,

When I try to bind an empty ArrayCollection or with only 1 item to a
Datagrid, I'm getting a runtime error (sorry it's in french but the
error number means something in this case):

TypeError: Error #1034: Echec de la contrainte de type : conversion de
mx.utils::[EMAIL PROTECTED] en mx.collections.ArrayCollection
impossible.

Here's the code I use :

private function handler(event:ResultEvent):void {
grilleTerrainsACDP = event.result.terrains.terrain;
}

And the "grilleTerrainsACDP" variable who's binded to my datagrid, as
the data provider, is declared this way:

[Bindable] public var grilleTerrainsACDP:ArrayCollection;

Any idea?

I use a ArrayCollection for ICursorView...

Thanks
Nicolas

 



Re: [flexcoders] ArrayCollection length

2007-02-28 Thread feiy

u can use the 
mx.collections.ArrayCollection
's 
filterFunction:
Functionproperty

2007/2/28, Mehul Doshi <[EMAIL PROTECTED]>:



If I have my dataprovider in the following manner:

var dataProvider = [{Date: "02-12-2007", Company1: 20, Company2: 30},
{Date: "02-09-2007", Company1: 20, Company2: 30},
{Date: "02-08-2007", Company1: 20, Company2: 30}]

How can I determine programatically:

1. The number of companies.
I dont't seem to be able to figure out how to find the number of
items in a particular element of the ArrayCollection.

2. Is there a way to structure the dataProvider so that I can also
include the company names. Thus, I can use those names for my legend.

Thanks.



 





--
闲云孤鹤 - 清冷香中抱膝吟


RE: [flexcoders] ArrayCollection does not yield the same results as dataGrid

2007-01-02 Thread Battershall, Jeff
Looks like you're going one level too deep in your source attribute for
your ArrayCollection. Also your XML example is malformed, you're closing
records before record but I'm guessing that's just a typo.

Jeff

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of pdflibpilot
Sent: Tuesday, January 02, 2007 1:23 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] ArrayCollection does not yield the same results as
dataGrid


I am using an HTTPservice request to get a set of records in basic
format like so

MyField

I am using the default result format for this request:

http://myDomain.com/getRecords.php"; useProxy="false"
method="POST"   >

I then have an ArrayCollection bound to the request:



Whenever I try to reference a returned record using the following:

annotInfo.getItemAt(0).mergeField  I get the error 'mergeField' is
undefined.

However the counterpart reference via the dataGrid works fine:

annotDG.dataProvider.getItemAt(0).mergeField 

What am I missing here ? I have used AC before many times without any
problem



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





Re: [flexcoders] ArrayCollection...how can I edit the data?

2006-08-31 Thread Tom Chiverton
On Monday 28 August 2006 21:14, qnotemedia wrote:
> TextInputs.  I've tried many things.  The only thing that "works" is
> editing the values of the Flex2 objects (the combobox or the
> datagrid).  This is not ideal, since in step5, I will have to rebuild

If these controls are bound to a data provider, just update that.

-- 
Tom Chiverton
Helping to dynamically lead B2B bandwidth



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] arraycollection to xml

2006-08-18 Thread Tracy Spratt












Don’t put it in a Model, that
changes it to an mx:Object.  Leave it as XML.

 

Use e4x to access the nodes or node lists
you want, and then convert them into the Array or XMLList collections you need
for your data providers.

 

Update the main XML.  When you are ready
to send the xml will be ready as well.

 

Tracy

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of keithtucci
Sent: Thursday, August 17, 2006
10:12 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
arraycollection to xml



 







i have an xml as my source for a model which i use as
the source for 
arraycollection. in my array collection i may add or remove items. 
i would like to get the modified arraycollection back to xml format. 
the reason for needing the arraycollection in xml format is i use 
zinc to save the xml file locally.

--

public function addPerson():void {
ac.addItem({first:firstInput.text, last:lastInput.text,
email:emailInput.text});
//clearInputs();
}

public function removePerson():void {
if (dg.selectedIndex >= 0) {
ac.removeItemAt(dg.selectedIndex);
}
}

public function updatePerson():void {
if (dg.selectedItem !== null) {
ac.setItemAt({first:firstInput.text, last:lastInput.text,
email:emailInput.text}, dg.selectedIndex);
}
}



collectionChange="collectionEventHandler(event)"/>

"{ac}"
change="dgChangeHandler()">
















any help will be greatly appreciated...

thanks

keith






__._,_.___





--
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
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  







  
  
  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.



  






__,_._,___






Re: [flexcoders] ArrayCollection object to Model for Remoting Help

2006-08-15 Thread Nick Collins



The problem was how to get the right data into the model. I figured it out.. had to put them in using arrayName.getItemAt(item).fieldNameOn 8/15/06, Matt Chotin
 <[EMAIL PROTECTED]> wrote:












  













When you add the item into the transaction
array it's a new object each time right?  So each element in the array
essentially should be the copy of the model at that point?  You should then
just call saveItem(item) when you iterate through the transactionArray I think.
 

 

Matt

 









From: [EMAIL PROTECTED]
ups.com
[mailto:flexcoders@yahoogroups.com] On Behalf
Of Nick Collins
Sent: Tuesday, August 15, 2006
12:12 AM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders]
ArrayCollection object to Model for Remoting Help



 







Ok, I've
got a form that requires me to be able to have multiple subtransactions that
can be submitted with one click.

The way I have it set up is when you've completed the form you click a button
and it adds the values of the form fields to an object within an
ArrayCollection. That ArrayCollection is bindable and is set as the dataprovider
for a datagrid that lists these sub-transactions. I can add as many items to
this "queue" as I like, and that part works just fine. 

The part I'm having trouble with is when I want to post those records to the
database.

I have a model set up for the remoting. It worked fine when I was passing the
values from the form to the model then to the DB, but I'm not sure how to pass
the data from the ArrayCollection into the model to be submitted. 

In the save function I have the following code

for each (var item:Object in transactionArray)
                {
               
    saveItem(this.detailObject);
                }

where transactionArray is the ArrayCollection and detailObject is the model.
Now, it does run the remoting call for each of the line items, it's just not
putting the data into the model, so I'm getting empty records. 

My ArrayCollection looks like this:

private var transactionArray:ArrayCollection = new ArrayCollection(
               
            [{
               
                EnvNum:
'',
               
               
DateTrans: '', 
               
               
Currency: '', 
               
               
CheckNum: '', 
               
               
Fund: '', 
               
               
Amount: '', 
               
               
Comment: '', 
               
               
TransID: '',
               
               
UUID: ''
               
            }]);

How can I bind an individual property of transactionArray, such as EnvNum to my
model, detailObject 


        {this._key as
String}
        {Number(subTransEnvNum.itemToLabel(this))}

        {subTransDateTrans.itemToLabel(this)
as Date}
        {subTransCurrency.itemToLabel(this)
as String}
        {Number(
subTransCheckNum.itemToLabel(this))}
        {subTransFund.itemToLabel(this)
as String}
        {Number(subTransAmount.itemToLabel(this))}

        {subTransComment.itemToLabel(this)
as String}
        {subTransTransID.itemToLabel(this)
as String}
        { subTransUUID.itemToLabel(this)
as String}


this doesn't work, all the values come in as null. I was trying to pull the
values from the DataGridColumns, but that wasn't working for me here. Please
help! Thanks if advance. 










  















__._,_.___





--
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



   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.



  






__,_._,___



RE: [flexcoders] ArrayCollection object to Model for Remoting Help

2006-08-15 Thread Matt Chotin












When you add the item into the transaction
array it’s a new object each time right?  So each element in the array
essentially should be the copy of the model at that point?  You should then
just call saveItem(item) when you iterate through the transactionArray I think.
 

 

Matt

 









From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf
Of Nick Collins
Sent: Tuesday, August 15, 2006
12:12 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
ArrayCollection object to Model for Remoting Help



 







Ok, I've
got a form that requires me to be able to have multiple subtransactions that
can be submitted with one click.

The way I have it set up is when you've completed the form you click a button
and it adds the values of the form fields to an object within an
ArrayCollection. That ArrayCollection is bindable and is set as the dataprovider
for a datagrid that lists these sub-transactions. I can add as many items to
this "queue" as I like, and that part works just fine. 

The part I'm having trouble with is when I want to post those records to the
database.

I have a model set up for the remoting. It worked fine when I was passing the
values from the form to the model then to the DB, but I'm not sure how to pass
the data from the ArrayCollection into the model to be submitted. 

In the save function I have the following code

for each (var item:Object in transactionArray)
                {
               
    saveItem(this.detailObject);
                }

where transactionArray is the ArrayCollection and detailObject is the model.
Now, it does run the remoting call for each of the line items, it's just not
putting the data into the model, so I'm getting empty records. 

My ArrayCollection looks like this:

private var transactionArray:ArrayCollection = new ArrayCollection(
               
            [{
               
                EnvNum:
'',
               
               
DateTrans: '', 
               
               
Currency: '', 
               
               
CheckNum: '', 
               
               
Fund: '', 
               
               
Amount: '', 
               
               
Comment: '', 
               
               
TransID: '',
               
               
UUID: ''
               
            }]);

How can I bind an individual property of transactionArray, such as EnvNum to my
model, detailObject 

d id="detailObject">
        {this._key as
String}
        {Number(subTransEnvNum.itemToLabel(this))}

        {subTransDateTrans.itemToLabel(this)
as Date}
        {subTransCurrency.itemToLabel(this)
as String}
        {Number(
subTransCheckNum.itemToLabel(this))}
        {subTransFund.itemToLabel(this)
as String}
        {Number(subTransAmount.itemToLabel(this))}

        {subTransComment.itemToLabel(this)
as String}
        {subTransTransID.itemToLabel(this)
as String}
        { subTransUUID.itemToLabel(this)
as String}
d>

this doesn't work, all the values come in as null. I was trying to pull the
values from the DataGridColumns, but that wasn't working for me here. Please
help! Thanks if advance. 






__._,_.___





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








   



  




  
  
  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.



  






__,_._,___






RE: [flexcoders] ArrayCollection

2006-07-28 Thread Mike Anderson





Oh, this makes sense.
 
Thanks for the clarification - I was dealing with this 
problem too, and it all seems to work now, after I treat the result as an 
ArrayCollection right off the bat.
 
Thank you for your input on this,
 
Mike


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Mike 
NimerSent: Friday, July 28, 2006 9:56 AMTo: 
flexcoders@yahoogroups.comSubject: Re: [flexcoders] 
ArrayCollection


>countries 
= event.result. countries as ArrayCollection;
In 
ColdFusion all queries are returned as a true ArrayCollection objects, so you 
don't need to create your own. So with this syntax you are just casting, or 
telling the compiler, the variable that you already know the datatype of 
(ArrayCollection) is an real ArrayCollection.
>countries 
= new ArrayCollection(event.result.countries as Array);
 
Here you 
are telling the compiler the result is an Array, so you need to *create* a new 
ArrayCollection object based on this array. 
hth,
---nimer
 
- 
Original Message From: jtooley_1999 <[EMAIL PROTECTED]>To: 
flexcoders@yahoogroups.comSent: Friday, July 28, 2006 2:03:28 AMSubject: 
[flexcoders] ArrayCollection

Hi all,I am banging my head against the wall on this one.We 
have an app that runs on two different servers.One calls a CFC and uses 
The other one calls a java servlet using 
 but they bothretrieve the same data.With the 
CFC we are using remoting and we can access the data by goingpublic 
function geoResultHandler( event:ResultEven t):void{countries = 
event.result. countries as ArrayCollection;// differenceblah blah 
blah... more code}and to call itchange="setProvince ()" 
width="90%">This works great.But with 
 .. using that way returns null.. so we have touse the 
followingpublic function geoResultHandler( event:ResultEven 
t):void{countries = new ArrayCollection( event.result. countriesas 
Array); // differenceblah blah blah... more code}change="setProvince ()" 
width="90%">Can anyone explain the difference of using a variable as 
anArrayCollection instead of declaring new ArrayCollection( 
)ThanksJeremy Tooley
 
__._,_.___





--
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



   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.



  






__,_._,___



Re: [flexcoders] ArrayCollection

2006-07-28 Thread We Made That design
Thanks Mike

That really opened my eyes and helped me understand..


>>countries = event.result. countries as ArrayCollection;
>
> In ColdFusion all queries are returned as a true ArrayCollection objects,
> so you don't need to create your own. So with this syntax you are just
> casting, or telling the compiler, the variable that you already know the
> datatype of (ArrayCollection) is an real ArrayCollection.
>
>>countries = new ArrayCollection(event.result.countries as Array);
>
> Here you are telling the compiler the result is an Array, so you need to
> *create* a new ArrayCollection object based on this array.
>
> hth,
> ---nimer
>
> - Original Message 
> From: jtooley_1999 <[EMAIL PROTECTED]>
> To: flexcoders@yahoogroups.com
> Sent: Friday, July 28, 2006 2:03:28 AM
> Subject: [flexcoders] ArrayCollection
>
> Hi all,
>
> I am banging my head against the wall on this one.
>
> We have an app that runs on two different servers.
> One calls a CFC and uses 
> The other one calls a java servlet using  but they both
> retrieve the same data.
>
> With the CFC we are using remoting and we can access the data by going
>
> public function geoResultHandler( event:ResultEven t):void
> {
> countries = event.result. countries as ArrayCollection;
> // difference
> blah blah blah... more code
> }
>
> and to call it
>  change="setProvince ()" width="90%">
>
> This works great.
>
> But with  .. using that way returns null.. so we have to
> use the following
>
> public function geoResultHandler( event:ResultEven t):void
> {
> countries = new ArrayCollection( event.result. countries
> as Array); // difference
> blah blah blah... more code
> }
>
>  change="setProvince ()" width="90%">
>
> Can anyone explain the difference of using a variable as an
> ArrayCollection instead of declaring new ArrayCollection( )
>
> Thanks
> Jeremy Tooley
>
>
>


Jeremy Tooley
Creative Director
We Made That Design Group Inc.
[EMAIL PROTECTED]
http://www.wemadethat.com
p: 403.668.0857
c: 403.836.3048



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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] ArrayCollection

2006-07-28 Thread Mike Anderson
YES, see this is the exact information, that I was going off too -

I always run Service Sniffer applications (in my case, Kevin Langdon's
Service Browser) which directly supports Remoting Objects, and I saw the
exact same things brought back with my ColdFusion returned Queries.

This is why I was so hung up on Arrays, and why I was having such a hard
time understanding why Flex couldn't decode it.

I just thought I'd throw in my 2 cents on this particular reply, because
I am sure other developers will be thinking the same things too - and
the information contained in this thread, will prove to be highly
valuable.

Thanks everyone for all your help,

Mike

-Original Message-
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Tom Chiverton
Sent: Friday, July 28, 2006 10:38 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] ArrayCollection

On Friday 28 July 2006 15:56, Mike Nimer wrote:
> In ColdFusion all queries are returned as a true ArrayCollection 
> objects,

*Really* ?!?
The debug output says it's an Array.

I think I must be missing something, in which case I blame lunch :-)

[Flex] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/10/onResult, responseURI=)
(Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
  destination = null
  headers = (Object #1)
  correlationId = "1F432A79-7F15-B888-E7DA-B5C138CC7BBE"
  messageId = "7BCBD83A-E0C4-AE6B-F2DF-6B47BFFD315F"
  timestamp = 1.154100574606E12
  clientId = "7BC494F2-508E-E430-7AB5-95B55B2EF00C"
  timeToLive = 0.0
  body = (Array #2)
[0] = (Object #3)
  fh_when = 2006-07-25 15:03:54.0
  usr_dept = "IT"
  usr_name = srfas asdf "
  fh_desc = "i need this for a very important case"
  usr_email = "asd [EMAIL PROTECTED]"
  fst_desc = "PendingApprovalForRelease"
[1] = (Object #5)
  fh_when = 2003-03-12 00:00:00.0
  usr_dept = "0060"
  usr_name = "Historic user"
  fh_desc = "Historical Movement"
  usr_email = "N/A"
  fst_desc = "ArchivedAtSL"

--
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England
and Wales under registered number OC307980 whose registered office
address is at St James's Court Brown Street Manchester M2 2JF.  A list
of members is available for inspection at the registered office. Any
reference to a partner in relation to Halliwells LLP means a member of
Halliwells LLP. Regulated by the Law Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and
may be confidential or legally privileged.  If you are not the addressee
you must not read it and must not use any information contained in nor
copy it nor inform any person other than Halliwells LLP or the addressee
of its existence or contents.  If you have received this email in error
please delete it and notify Halliwells LLP IT Department on 0870 365
8008.

For more information about Halliwells LLP visit www.halliwells.com.



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



 




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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] ArrayCollection

2006-07-28 Thread Tom Chiverton
On Friday 28 July 2006 16:38, Tom Chiverton wrote:
> The debug output says it's an Array.

Yes, Tom, that's because your service layer (you know, the one you wrote) is 
translating it for you.

> I think I must be missing something, in which case I blame lunch :-)

Note to self: One Pint Only.

-- 
oTm Cihverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] ArrayCollection

2006-07-28 Thread Tom Chiverton
On Friday 28 July 2006 15:56, Mike Nimer wrote:
> In ColdFusion all queries are returned as a true ArrayCollection objects,

*Really* ?!?
The debug output says it's an Array.

I think I must be missing something, in which case I blame lunch :-)

[Flex] Serializing AMF/HTTP response
Version: 3
  (Message #0 targetURI=/10/onResult, responseURI=)
(Typed Object #0 'flex.messaging.messages.AcknowledgeMessage')
  destination = null
  headers = (Object #1)
  correlationId = "1F432A79-7F15-B888-E7DA-B5C138CC7BBE"
  messageId = "7BCBD83A-E0C4-AE6B-F2DF-6B47BFFD315F"
  timestamp = 1.154100574606E12
  clientId = "7BC494F2-508E-E430-7AB5-95B55B2EF00C"
  timeToLive = 0.0
  body = (Array #2)
[0] = (Object #3)
  fh_when = 2006-07-25 15:03:54.0
  usr_dept = "IT"
  usr_name = srfas asdf "
  fh_desc = "i need this for a very important case"
  usr_email = "asd [EMAIL PROTECTED]"
  fst_desc = "PendingApprovalForRelease"
[1] = (Object #5)
  fh_when = 2003-03-12 00:00:00.0
  usr_dept = "0060"
  usr_name = "Historic user"
  fh_desc = "Historical Movement"
  usr_email = "N/A"
  fst_desc = "ArchivedAtSL"

-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




Re: [flexcoders] ArrayCollection

2006-07-28 Thread Mike Nimer


>countries = event.result. countries as ArrayCollection;
In ColdFusion all queries are returned as a true ArrayCollection objects, so you don't need to create your own. So with this syntax you are just casting, or telling the compiler, the variable that you already know the datatype of (ArrayCollection) is an real ArrayCollection.
>countries = new ArrayCollection(event.result.countries as Array);
 
Here you are telling the compiler the result is an Array, so you need to *create* a new ArrayCollection object based on this array. 
hth,
---nimer
 
- Original Message From: jtooley_1999 <[EMAIL PROTECTED]>To: flexcoders@yahoogroups.comSent: Friday, July 28, 2006 2:03:28 AMSubject: [flexcoders] ArrayCollection

Hi all,I am banging my head against the wall on this one.We have an app that runs on two different servers.One calls a CFC and uses The other one calls a java servlet using  but they bothretrieve the same data.With the CFC we are using remoting and we can access the data by goingpublic function geoResultHandler( event:ResultEven t):void{countries = event.result. countries as ArrayCollection;// differenceblah blah blah... more code}and to call itchange="setProvince ()" width="90%">This works great.But with  .. using that way returns null.. so we have touse the followingpublic function geoResultHandler( event:ResultEven t):void{countries = new
 ArrayCollection( event.result. countriesas Array); // differenceblah blah blah... more code}change="setProvince ()" width="90%">Can anyone explain the difference of using a variable as anArrayCollection instead of declaring new ArrayCollection( )ThanksJeremy Tooley

__._,_.___





--
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



   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.



  






__,_._,___


Re: [flexcoders] ArrayCollection

2006-07-28 Thread Tom Chiverton
On Friday 28 July 2006 07:03, jtooley_1999 wrote:
> countries = event.result.countries as ArrayCollection;

Turns result straight into an ArrayCollection where as...

> countries = new ArrayCollection(event.result.countries
> as Array); // difference

. turns result into an array and uses that as the constructor argument to an 
ArrayCollection.

Which should hopefully make the difference clear.
All our CFC RemoteObject calls use the latter syntax, by the way, as it 
appears the the on-the-wire structure (based on the debug log) is Array.
-- 
Tom Chiverton



This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at St 
James's Court Brown Street Manchester M2 2JF.  A list of members is available 
for inspection at the registered office. Any reference to a partner in relation 
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law 
Society.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 8008.

For more information about Halliwells LLP visit www.halliwells.com.



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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] ArrayCollection as datasource

2006-07-11 Thread Pottavathini, Sathish





I'm 
getting the data in similar way as well. A similar request for something else 
gave me XML but in this case i am gettting ObjectProxy, any idea 
why?
 
Sathish

  -Original Message-From: flexcoders@yahoogroups.com 
  [mailto:[EMAIL PROTECTED]On Behalf Of Jonas 
  WindeySent: Monday, July 10, 2006 6:05 AMTo: 
  flexcoders@yahoogroups.comSubject: [flexcoders] ArrayCollection as 
  datasource
  
  Hi,
   
  I’m using a webservice to provide 
  data to a tree but I can’t seem to bind the data. The datatype of my operation 
  is Object (with e4x I get other problems and I’d like to keep it Object for 
  all my operation), and the result looks like 
this:
   
  result = mx.utils.ObjectProxy 
  (@3977541)
      
  object = Object (@3967381)
      
  selectAllDirectoriesResult = mx.utils.ObjectProxy 
  (@3a715c1)
      
  object = Object (@3a67521)
      
  root = mx.utils.ObjectProxy (@3a71cc1)
      
  node = 
  mx.collections.ArrayCollection (@39222b1)
      
  object = Object (@3a38d01)
      
  node = mx.collections.ArrayCollection (@39222b1)
      
  [0] = mx.utils.ObjectProxy (@3a71d41)
      
  label = "pixco"
      
  nbrFiles = "0"
      
  object = Object (@3a6de81)
      
  uid = "754C8DC3-6ADC-2912-C233-5880843A46A2"
      
  [1] = mx.utils.ObjectProxy (@3a71d81)
      
  label = "pixco_id"
      
  nbrFiles = "0"
      
  node = mx.utils.ObjectProxy (@3a7f0c1)
      
  label = 
  "test"
      
  nbrFiles = "0"
      
  node = mx.utils.ObjectProxy (@3a7f241)
      
  label = "test2"
      
  nbrFiles = "0"
      
  node = mx.collections.ArrayCollection (@39b5e81)
      
  [0] = mx.utils.ObjectProxy (@3a7f2c1)
      
  [1] = mx.utils.ObjectProxy (@3a7f301)
      
      
  filterFunction = null
      
  length = 2 [0x2]
      
  list = mx.collections.ArrayList (@3a7f341)
      
  sort = null
      
  source = Array (@39b5fd1)
      
  object = Object (@3a85041)
      
  uid = "B30C5FD7-96DD-44CB-5D4C-588084459E45"
      
  object = Object (@3a675a1)
      
  uid = "F49EDC31-C665-13C9-BD37-5880843A15D1"
      
  object = Object (@3a6daa1)
      
  uid = "C5BB5321-B5D8-CB23-4F34-5880843A5850"
      
  filterFunction = null
      
  length = 2 [0x2]
      
  list = mx.collections.ArrayList (@3a7f381)
      
  sort = null
    

RE: [flexcoders] arrayCollection to custom value object

2006-07-06 Thread Shannon Hicks





The light bulb just went on! Thanks for pointing me in the 
right direction!
 
Shan


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Peter 
FarlandSent: Thursday, July 06, 2006 10:18 AMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object




This is controlled by 
CFQuery, so you’d either have to change the data format in CF before you return 
it, or continue to do what you’re doing on the client by copying each property 
across (although I’d use a for/in loop and [propName]-styled syntax against the 
currentUser type rather than specifically writing a line to copy each item). You 
can’t cast an Object into another type unless it is literally of that type to 
begin with… as is the case with any strongly typed 
language.





From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon HicksSent: Thursday, July 06, 2006 11:03 
AMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object




The ArrayCollection was 
returned from a CFC (just a simple select * query).

Shan




From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Peter FarlandSent: Thursday, July 06, 2006 9:23 
AMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object


I don’t have enough 
information here to determine how you got an ArrayCollection in the first 
place?




From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon HicksSent: Wednesday, July 05, 2006 11:34 
PMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object



So, how can I get my 
ArrayCollection row into my object? It's cool that I can test and see that it's 
not working using "IS", but it doesn't solve the problem, just allows me to 
trap it :)
Shan



From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Peter FarlandSent: Wednesday, July 05, 2006 10:07 
PMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object


The item may not be an 
instance of user, but rather an anonymous Object that contains the correct 
properties that match the public interface of the user class. The “as” operator 
returns null if the instance cannot be coerced into the requested type… where as 
traditional casting syntax will throw an error. You can use 
getQualifiedClassName or the “is” operator to determine whether an instance is 
of a particular type before casting or using the as 
operator.




From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon HicksSent: Wednesday, July 05, 2006 9:40 
PMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] arrayCollection to 
custom value object




So, I've got an ArrayCollection and 
a defined value object. The ArrayCollection has just one record in it, and the 
data matches the valueObject perfectly. Here's my 
code:

If I do this, everything 
works:

  model.currentUser.userID 
= 
loginResult.getItemAt(0).userID;  model.currentUser.username 
= 
loginResult.getItemAt(0).username;  model.currentUser.name 
= 
loginResult.getItemAt(0).name;  model.currentUser.email 
= 
loginResult.getItemAt(0).email;  model.currentUser.city 
= 
loginResult.getItemAt(0).city;  model.currentUser.state 
= 
loginResult.getItemAt(0).state;  model.currentUser.country 
= 
loginResult.getItemAt(0).country;  model.currentUser.approved 
= 
loginResult.getItemAt(0).approved;  model.currentUser.lastLogin 
= 
loginResult.getItemAt(0).lastLogin;  model.currentUser.createDate 
= 
loginResult.getItemAt(0).createDate;

If I do EITHER OF THESE (not all at 
once), model.currentUser remains 
NULL:

1model.currentUser 
= loginResult.getItemAt(0) as 
user;2model.currentUser = loginResult as 
user;

Any ideas what I'm doing 
wrong?

Shan
--No virus found in this outgoing 
message.Checked by AVG Free Edition.Version: 7.1.394 / Virus Database: 
268.9.9/382 - Release Date: 
7/4/2006
--No 
virus found in this incoming message.Checked by AVG Free 
Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006
--No virus found in this outgoing 
message.Checked by AVG Free Edition.Version: 7.1.394 / Virus Database: 
268.9.9/382 - Release Date: 
7/4/2006

--No 
virus found in this incoming message.Checked by AVG Free 
Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006

--No 
virus found in this outgoing message.Checked by AVG Free 
Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006


--No virus found in this incoming message.Checked by AVG 
Free Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcoders

RE: [flexcoders] arrayCollection to custom value object

2006-07-06 Thread Peter Farland












This is controlled by CFQuery, so you’d
either have to change the data format in CF before you return it, or continue
to do what you’re doing on the client by copying each property across (although
I’d use a for/in loop and [propName]-styled syntax against the currentUser type
rather than specifically writing a line to copy each item). You can’t cast an
Object into another type unless it is literally of that type to begin with… as
is the case with any strongly typed language.

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon Hicks
Sent: Thursday, July 06, 2006
11:03 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
arrayCollection to custom value object



 







The ArrayCollection was returned from a
CFC (just a simple select * query).

 

Shan

 







From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Peter Farland
Sent: Thursday, July 06, 2006 9:23
AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
arrayCollection to custom value object







I don’t have enough information here to determine how you got an
ArrayCollection in the first place?











From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On Behalf Of Shannon Hicks
Sent: Wednesday, July 05, 2006
11:34 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
arrayCollection to custom value object











So, how can I get my ArrayCollection row into my object? It's cool
that I can test and see that it's not working using "IS", but it
doesn't solve the problem, just allows me to trap it :)

Shan









From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On Behalf Of Peter Farland
Sent: Wednesday, July 05, 2006
10:07 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
arrayCollection to custom value object







The item may not be an instance of user, but rather an anonymous
Object that contains the correct properties that match the public interface of
the user class. The “as” operator returns null if the instance cannot be
coerced into the requested type… where as traditional casting syntax will throw
an error. You can use getQualifiedClassName or the “is” operator to determine
whether an instance is of a particular type before casting or using the as
operator.











From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On Behalf Of Shannon Hicks
Sent: Wednesday, July 05, 2006
9:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
arrayCollection to custom value object













So, I've got
an ArrayCollection and a defined value object. The ArrayCollection has just one
record in it, and the data matches the valueObject perfectly. Here's my code:





If I
do this, everything works:





  model.currentUser.userID
= loginResult.getItemAt(0).userID;
  model.currentUser.username =
loginResult.getItemAt(0).username;
  model.currentUser.name = loginResult.getItemAt(0).name;
  model.currentUser.email =
loginResult.getItemAt(0).email;
  model.currentUser.city =
loginResult.getItemAt(0).city;
  model.currentUser.state =
loginResult.getItemAt(0).state;
  model.currentUser.country =
loginResult.getItemAt(0).country;
  model.currentUser.approved =
loginResult.getItemAt(0).approved;
  model.currentUser.lastLogin =
loginResult.getItemAt(0).lastLogin;
  model.currentUser.createDate =
loginResult.getItemAt(0).createDate;





If I do
EITHER OF THESE (not all at once), model.currentUser remains NULL:





1model.currentUser
= loginResult.getItemAt(0) as user;
2model.currentUser = loginResult as user;





Any
ideas what I'm doing wrong?





Shan



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006











--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006











 



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006

 

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006






__._,_.___





--
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
  
  

RE: [flexcoders] arrayCollection to custom value object

2006-07-06 Thread Shannon Hicks





The ArrayCollection was returned from a CFC (just a simple 
select * query).
 
Shan


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Peter 
FarlandSent: Thursday, July 06, 2006 9:23 AMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object




I don’t have enough 
information here to determine how you got an ArrayCollection in the first 
place?





From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon HicksSent: Wednesday, July 05, 2006 11:34 
PMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object




So, how can I get my 
ArrayCollection row into my object? It's cool that I can test and see that it's 
not working using "IS", but it doesn't solve the problem, just allows me to 
trap it :)

Shan




From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Peter FarlandSent: Wednesday, July 05, 2006 10:07 
PMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object


The item may not be an 
instance of user, but rather an anonymous Object that contains the correct 
properties that match the public interface of the user class. The “as” operator 
returns null if the instance cannot be coerced into the requested type… where as 
traditional casting syntax will throw an error. You can use 
getQualifiedClassName or the “is” operator to determine whether an instance is 
of a particular type before casting or using the as 
operator.




From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon HicksSent: Wednesday, July 05, 2006 9:40 
PMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] arrayCollection to 
custom value object




So, I've got an ArrayCollection and 
a defined value object. The ArrayCollection has just one record in it, and the 
data matches the valueObject perfectly. Here's my 
code:

If I do this, everything 
works:

  model.currentUser.userID 
= 
loginResult.getItemAt(0).userID;  model.currentUser.username 
= 
loginResult.getItemAt(0).username;  model.currentUser.name 
= 
loginResult.getItemAt(0).name;  model.currentUser.email 
= 
loginResult.getItemAt(0).email;  model.currentUser.city 
= 
loginResult.getItemAt(0).city;  model.currentUser.state 
= 
loginResult.getItemAt(0).state;  model.currentUser.country 
= 
loginResult.getItemAt(0).country;  model.currentUser.approved 
= 
loginResult.getItemAt(0).approved;  model.currentUser.lastLogin 
= 
loginResult.getItemAt(0).lastLogin;  model.currentUser.createDate 
= loginResult.getItemAt(0).createDate;

If I do EITHER OF THESE (not all at 
once), model.currentUser remains NULL:

1model.currentUser 
= loginResult.getItemAt(0) as 
user;2model.currentUser = loginResult as 
user;

Any ideas what I'm doing 
wrong?

Shan
--No virus found in this outgoing 
message.Checked by AVG Free Edition.Version: 7.1.394 / Virus Database: 
268.9.9/382 - Release Date: 
7/4/2006

--No 
virus found in this incoming message.Checked by AVG Free 
Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006

--No 
virus found in this outgoing message.Checked by AVG Free 
Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006


--No virus found in this incoming message.Checked by AVG 
Free Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006
__._,_.___





--
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



   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.



  






__,_._,___



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006
 


RE: [flexcoders] arrayCollection to custom value object

2006-07-06 Thread Peter Farland












I don’t have enough information here to
determine how you got an ArrayCollection in the first place?

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon Hicks
Sent: Wednesday, July 05, 2006
11:34 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
arrayCollection to custom value object



 







So, how can I get my ArrayCollection row
into my object? It's cool that I can test and see that it's not working using
"IS", but it doesn't solve the problem, just allows me to
trap it :)

 

Shan

 







From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Peter Farland
Sent: Wednesday, July 05, 2006
10:07 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders]
arrayCollection to custom value object







The item may not be an instance of user, but rather an anonymous
Object that contains the correct properties that match the public interface of
the user class. The “as” operator returns null if the instance cannot be
coerced into the requested type… where as traditional casting syntax will throw
an error. You can use getQualifiedClassName or the “is” operator to determine
whether an instance is of a particular type before casting or using the as
operator.











From: flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com]
On Behalf Of Shannon Hicks
Sent: Wednesday, July 05, 2006
9:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
arrayCollection to custom value object













So, I've got
an ArrayCollection and a defined value object. The ArrayCollection has just one
record in it, and the data matches the valueObject perfectly. Here's my code:





If I
do this, everything works:





  model.currentUser.userID
= loginResult.getItemAt(0).userID;
  model.currentUser.username =
loginResult.getItemAt(0).username;
  model.currentUser.name =
loginResult.getItemAt(0).name;
  model.currentUser.email =
loginResult.getItemAt(0).email;
  model.currentUser.city =
loginResult.getItemAt(0).city;
  model.currentUser.state =
loginResult.getItemAt(0).state;
  model.currentUser.country =
loginResult.getItemAt(0).country;
  model.currentUser.approved =
loginResult.getItemAt(0).approved;
  model.currentUser.lastLogin =
loginResult.getItemAt(0).lastLogin;
  model.currentUser.createDate =
loginResult.getItemAt(0).createDate;





If I do
EITHER OF THESE (not all at once), model.currentUser remains NULL:





1model.currentUser
= loginResult.getItemAt(0) as user;
2model.currentUser = loginResult as user;





Any
ideas what I'm doing wrong?





Shan



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006











 



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006

 

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006






__._,_.___





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








   



  




  
  
  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.



  






__,_._,___






RE: [flexcoders] arrayCollection to custom value object

2006-07-05 Thread Shannon Hicks





So, how can I get my ArrayCollection row into my object? 
It's cool that I can test and see that it's not working using "IS", but it 
doesn't solve the problem, just allows me to 
trap it :)
 
Shan


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Peter 
FarlandSent: Wednesday, July 05, 2006 10:07 PMTo: 
flexcoders@yahoogroups.comSubject: RE: [flexcoders] arrayCollection 
to custom value object




The item may not be an 
instance of user, but rather an anonymous Object that contains the correct 
properties that match the public interface of the user class. The “as” operator 
returns null if the instance cannot be coerced into the requested type… where as 
traditional casting syntax will throw an error. You can use 
getQualifiedClassName or the “is” operator to determine whether an instance is 
of a particular type before casting or using the as 
operator.





From: 
flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon HicksSent: Wednesday, July 05, 2006 9:40 
PMTo: 
flexcoders@yahoogroups.comSubject: [flexcoders] arrayCollection to 
custom value object





So, I've got an ArrayCollection and 
a defined value object. The ArrayCollection has just one record in it, and the 
data matches the valueObject perfectly. Here's my 
code:



If I do this, everything 
works:

  model.currentUser.userID 
= 
loginResult.getItemAt(0).userID;  model.currentUser.username 
= 
loginResult.getItemAt(0).username;  model.currentUser.name 
= 
loginResult.getItemAt(0).name;  model.currentUser.email 
= 
loginResult.getItemAt(0).email;  model.currentUser.city 
= 
loginResult.getItemAt(0).city;  model.currentUser.state 
= 
loginResult.getItemAt(0).state;  model.currentUser.country 
= 
loginResult.getItemAt(0).country;  model.currentUser.approved 
= 
loginResult.getItemAt(0).approved;  model.currentUser.lastLogin 
= 
loginResult.getItemAt(0).lastLogin;  model.currentUser.createDate 
= loginResult.getItemAt(0).createDate;

If I do EITHER OF THESE (not all at 
once), model.currentUser remains NULL:

1model.currentUser 
= loginResult.getItemAt(0) as 
user;2model.currentUser = loginResult as 
user;



Any ideas what I'm doing 
wrong?



Shan

--No 
virus found in this outgoing message.Checked by AVG Free 
Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006


--No virus found in this incoming message.Checked by AVG 
Free Edition.Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 
7/4/2006
__._,_.___





--
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



   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.



  






__,_._,___



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006
 


RE: [flexcoders] arrayCollection to custom value object

2006-07-05 Thread Peter Farland












The item may not be an instance of user,
but rather an anonymous Object that contains the correct properties that match
the public interface of the user class. The “as” operator returns null if the instance
cannot be coerced into the requested type… where as traditional casting syntax
will throw an error. You can use getQualifiedClassName or the “is” operator to
determine whether an instance is of a particular type before casting or using
the as operator.

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Shannon Hicks
Sent: Wednesday, July 05, 2006
9:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
arrayCollection to custom value object



 









So, I've got an ArrayCollection and a defined value object.
The ArrayCollection has just one record in it, and the data matches the
valueObject perfectly. Here's my code:





 





If I do this, everything works:





  model.currentUser.userID
= loginResult.getItemAt(0).userID;
  model.currentUser.username =
loginResult.getItemAt(0).username;
  model.currentUser.name = loginResult.getItemAt(0).name;
  model.currentUser.email =
loginResult.getItemAt(0).email;
  model.currentUser.city =
loginResult.getItemAt(0).city;
  model.currentUser.state =
loginResult.getItemAt(0).state;
  model.currentUser.country =
loginResult.getItemAt(0).country;
  model.currentUser.approved =
loginResult.getItemAt(0).approved;
  model.currentUser.lastLogin =
loginResult.getItemAt(0).lastLogin;
  model.currentUser.createDate =
loginResult.getItemAt(0).createDate;





If I do EITHER OF THESE (not all at once), model.currentUser
remains NULL:





1model.currentUser =
loginResult.getItemAt(0) as user;
2model.currentUser = loginResult as user;





 





Any ideas what I'm doing wrong?





 





Shan



 

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006






__._,_.___





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








   



  




  
  
  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.



  






__,_._,___