RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Glenn Williams
are you asking how to reset an arraycollection back to zero values?

 

 

Glenn

 

 



 

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Monday, April 07, 2008 5:30 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

If the service returned an empty AC, I would verify that the DG has really
been assigned that empty AC.  Read back the dataProvider on the DG and see
what its length is.  You can also try to manually reset the DG to an empty
AC and see if it refreshes that way.

 

  _  

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jovialrandor
Sent: Sunday, April 06, 2008 5:13 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

Alex, the HTTPService returns an empty arraycollection, but the 
datagrid still has the values from the last call.

How do I in the code refresh the arraycollection, since the 'refresh
()' did not work?

Thanks

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ,
Alex Harui [EMAIL PROTECTED] wrote:

 I would think that your service should return an empty array 
collection,
 or return a failure. If it returns an empty array collection it 
should
 refresh. If it returns a failure, then you should set the
 arraycollection to an empty arraycollection on failure
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com  
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ]
On
 Behalf Of jovialrandor
 Sent: Saturday, April 05, 2008 9:16 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] How can I clear an ArrayCollection or 
Datagrid
 
 
 
 I use a HTTPService to load data into an ArrayCollection which is 
used 
 for a datagrid. For example I type in a parameter A to the 
 HTTPService that returns data that gets loaded in to 
ArrayCollectin.
 
 However when I when resend the HTTPservice with parameter B that 
 returns no data, the datagrid still displays the value of 
parameter A.
 
 I've tried:
 
 httpservice.send(); // To get new values
 arraycollection.refresh(). // To refresh the datagrid.
 
 But no luck.
 
 Thanks


 

image001.png

[flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Dmitri Girski
Hi Alex,

I believe that there is a bug/feature with binding HTTPService result
to a DataGrid. If HTTPService returns empty result (null), DataGrid
won't be cleared from a previous values.

To overcome this problem I had to use a dataProvider
variable(ArrayCollection) which I clear every time before the request
and then copy values from HTTPService.

Before this topic I thought that this is feature, but after I saw your
comments it is definitely a bug :)

PS  I have not found any other way of resetting the DataGrid. If you
assign dataProvider to an empty ArrayCollection it won't help
(presumably because DataGrid needs collectionChange event and nothing
else)



Cheers,
Dmitri.
 



--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 If the service returned an empty AC, I would verify that the DG has
 really been assigned that empty AC.  Read back the dataProvider on the
 DG and see what its length is.  You can also try to manually reset the
 DG to an empty AC and see if it refreshes that way.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of jovialrandor
 Sent: Sunday, April 06, 2008 5:13 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid
 
  
 
 Alex, the HTTPService returns an empty arraycollection, but the 
 datagrid still has the values from the last call.
 
 How do I in the code refresh the arraycollection, since the 'refresh
 ()' did not work?
 
 Thanks
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  I would think that your service should return an empty array 
 collection,
  or return a failure. If it returns an empty array collection it 
 should
  refresh. If it returns a failure, then you should set the
  arraycollection to an empty arraycollection on failure
  
  
  
  
  
  From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ] On
  Behalf Of jovialrandor
  Sent: Saturday, April 05, 2008 9:16 AM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
  Subject: [flexcoders] How can I clear an ArrayCollection or 
 Datagrid
  
  
  
  I use a HTTPService to load data into an ArrayCollection which is 
 used 
  for a datagrid. For example I type in a parameter A to the 
  HTTPService that returns data that gets loaded in to 
 ArrayCollectin.
  
  However when I when resend the HTTPservice with parameter B that 
  returns no data, the datagrid still displays the value of 
 parameter A.
  
  I've tried:
  
  httpservice.send(); // To get new values
  arraycollection.refresh(). // To refresh the datagrid.
  
  But no luck.
  
  Thanks
 





RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Tracy Spratt
I have used AC API method removeAll() to clear an AC, and it properly
updates the UI.

 

Assigning an empty AC should do it as well, though.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: Monday, April 07, 2008 12:30 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: How can I clear an ArrayCollection or
Datagrid

 

If the service returned an empty AC, I would verify that the DG has
really been assigned that empty AC.  Read back the dataProvider on the
DG and see what its length is.  You can also try to manually reset the
DG to an empty AC and see if it refreshes that way.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jovialrandor
Sent: Sunday, April 06, 2008 5:13 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

Alex, the HTTPService returns an empty arraycollection, but the 
datagrid still has the values from the last call.

How do I in the code refresh the arraycollection, since the 'refresh
()' did not work?

Thanks

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Alex Harui [EMAIL PROTECTED] wrote:

 I would think that your service should return an empty array 
collection,
 or return a failure. If it returns an empty array collection it 
should
 refresh. If it returns a failure, then you should set the
 arraycollection to an empty arraycollection on failure
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of jovialrandor
 Sent: Saturday, April 05, 2008 9:16 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] How can I clear an ArrayCollection or 
Datagrid
 
 
 
 I use a HTTPService to load data into an ArrayCollection which is 
used 
 for a datagrid. For example I type in a parameter A to the 
 HTTPService that returns data that gets loaded in to 
ArrayCollectin.
 
 However when I when resend the HTTPservice with parameter B that 
 returns no data, the datagrid still displays the value of 
parameter A.
 
 I've tried:
 
 httpservice.send(); // To get new values
 arraycollection.refresh(). // To refresh the datagrid.
 
 But no luck.
 
 Thanks


 



RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Alex Harui
I ran a simple test of DataGrid binding to arraycollection.  If I set an
empty array collection, the DataGrid resets properly.

 

If the HTTPService returns an empty ArrayCollection I would expect the
DG to also reset, but I don't have time to test that out.  If it returns
null, I'm not sure what it will generate, but again, if you detect that
it returns null and set the array collection to an empty array
collection it should reset the DG.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dmitri Girski
Sent: Monday, April 07, 2008 8:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

Hi Alex,

I believe that there is a bug/feature with binding HTTPService result
to a DataGrid. If HTTPService returns empty result (null), DataGrid
won't be cleared from a previous values.

To overcome this problem I had to use a dataProvider
variable(ArrayCollection) which I clear every time before the request
and then copy values from HTTPService.

Before this topic I thought that this is feature, but after I saw your
comments it is definitely a bug :)

PS I have not found any other way of resetting the DataGrid. If you
assign dataProvider to an empty ArrayCollection it won't help
(presumably because DataGrid needs collectionChange event and nothing
else)

Cheers,
Dmitri.


--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Alex Harui [EMAIL PROTECTED] wrote:

 If the service returned an empty AC, I would verify that the DG has
 really been assigned that empty AC. Read back the dataProvider on the
 DG and see what its length is. You can also try to manually reset the
 DG to an empty AC and see if it refreshes that way.
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of jovialrandor
 Sent: Sunday, April 06, 2008 5:13 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: How can I clear an ArrayCollection or
Datagrid
 
 
 
 Alex, the HTTPService returns an empty arraycollection, but the 
 datagrid still has the values from the last call.
 
 How do I in the code refresh the arraycollection, since the 'refresh
 ()' did not work?
 
 Thanks
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  I would think that your service should return an empty array 
 collection,
  or return a failure. If it returns an empty array collection it 
 should
  refresh. If it returns a failure, then you should set the
  arraycollection to an empty arraycollection on failure
  
  
  
  
  
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 
 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com
 ] On
  Behalf Of jovialrandor
  Sent: Saturday, April 05, 2008 9:16 AM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%40yahoogroups.com 
  Subject: [flexcoders] How can I clear an ArrayCollection or 
 Datagrid
  
  
  
  I use a HTTPService to load data into an ArrayCollection which is 
 used 
  for a datagrid. For example I type in a parameter A to the 
  HTTPService that returns data that gets loaded in to 
 ArrayCollectin.
  
  However when I when resend the HTTPservice with parameter B that 
  returns no data, the datagrid still displays the value of 
 parameter A.
  
  I've tried:
  
  httpservice.send(); // To get new values
  arraycollection.refresh(). // To refresh the datagrid.
  
  But no luck.
  
  Thanks
 


 



[flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Dmitri Girski
 Assigning an empty AC should do it as well, though.

Nope, it didn't work for me.

I had this problem with both DataGrid  AdvancedDataGrid and ended up
with intermediate ArrayCollection. 



[flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread jmfillman
removeAll() should do exactly what you are looking for, but only if 
your dataGrid's dataprovider is bound to the arrayCollection. If your 
dataGrid is not bound to the arrayCollection, the dataGrid will not 
change as data in the arrayCollection changes (unless you have 
accounted for this programatically elsewhere). If you do not want to 
use binding, the easiest thing would be to add a collection_change 
eventListener on the arrayCollection so you can clear out or update 
the dataGrid as the arrayCollection data changes.

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 I have used AC API method removeAll() to clear an AC, and it 
properly
 updates the UI.
 
  
 
 Assigning an empty AC should do it as well, though.
 
  
 
 Tracy
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of Alex Harui
 Sent: Monday, April 07, 2008 12:30 AM
 To: flexcoders@yahoogroups.com
 Subject: RE: [flexcoders] Re: How can I clear an ArrayCollection or
 Datagrid
 
  
 
 If the service returned an empty AC, I would verify that the DG has
 really been assigned that empty AC.  Read back the dataProvider on 
the
 DG and see what its length is.  You can also try to manually reset 
the
 DG to an empty AC and see if it refreshes that way.
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of jovialrandor
 Sent: Sunday, April 06, 2008 5:13 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: How can I clear an ArrayCollection or 
Datagrid
 
  
 
 Alex, the HTTPService returns an empty arraycollection, but the 
 datagrid still has the values from the last call.
 
 How do I in the code refresh the arraycollection, since the 'refresh
 ()' did not work?
 
 Thanks
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  I would think that your service should return an empty array 
 collection,
  or return a failure. If it returns an empty array collection it 
 should
  refresh. If it returns a failure, then you should set the
  arraycollection to an empty arraycollection on failure
  
  
  
  
  
  From: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com
 ] On
  Behalf Of jovialrandor
  Sent: Saturday, April 05, 2008 9:16 AM
  To: flexcoders@yahoogroups.com mailto:flexcoders%
40yahoogroups.com 
  Subject: [flexcoders] How can I clear an ArrayCollection or 
 Datagrid
  
  
  
  I use a HTTPService to load data into an ArrayCollection which is 
 used 
  for a datagrid. For example I type in a parameter A to the 
  HTTPService that returns data that gets loaded in to 
 ArrayCollectin.
  
  However when I when resend the HTTPservice with parameter B that 
  returns no data, the datagrid still displays the value of 
 parameter A.
  
  I've tried:
  
  httpservice.send(); // To get new values
  arraycollection.refresh(). // To refresh the datagrid.
  
  But no luck.
  
  Thanks
 





RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Alex Harui
Well, it worked for me in a simple test.  I'd be interested in your
scenario to see why it was different.  Maybe you had bindings that
overwrote your manual updating.

 

-Alex

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dmitri Girski
Sent: Monday, April 07, 2008 11:41 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

 Assigning an empty AC should do it as well, though.

Nope, it didn't work for me.

I had this problem with both DataGrid  AdvancedDataGrid and ended up
with intermediate ArrayCollection. 

 



RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Alex Harui
If you've assigned an arraycollection (as opposed to an array) to the
DataGrid but are not using binding, the DataGrid will refresh when you
call removeAll().  Whether you use binding or not, once the DG has a
reference to an arraycollection instance and you change that instance,
the datagrid will notice.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jmfillman
Sent: Monday, April 07, 2008 11:50 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

removeAll() should do exactly what you are looking for, but only if 
your dataGrid's dataprovider is bound to the arrayCollection. If your 
dataGrid is not bound to the arrayCollection, the dataGrid will not 
change as data in the arrayCollection changes (unless you have 
accounted for this programatically elsewhere). If you do not want to 
use binding, the easiest thing would be to add a collection_change 
eventListener on the arrayCollection so you can clear out or update 
the dataGrid as the arrayCollection data changes.

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Tracy Spratt [EMAIL PROTECTED] wrote:

 I have used AC API method removeAll() to clear an AC, and it 
properly
 updates the UI.
 
 
 
 Assigning an empty AC should do it as well, though.
 
 
 
 Tracy
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of Alex Harui
 Sent: Monday, April 07, 2008 12:30 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: RE: [flexcoders] Re: How can I clear an ArrayCollection or
 Datagrid
 
 
 
 If the service returned an empty AC, I would verify that the DG has
 really been assigned that empty AC. Read back the dataProvider on 
the
 DG and see what its length is. You can also try to manually reset 
the
 DG to an empty AC and see if it refreshes that way.
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of jovialrandor
 Sent: Sunday, April 06, 2008 5:13 PM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] Re: How can I clear an ArrayCollection or 
Datagrid
 
 
 
 Alex, the HTTPService returns an empty arraycollection, but the 
 datagrid still has the values from the last call.
 
 How do I in the code refresh the arraycollection, since the 'refresh
 ()' did not work?
 
 Thanks
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  mailto:flexcoders%
40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  I would think that your service should return an empty array 
 collection,
  or return a failure. If it returns an empty array collection it 
 should
  refresh. If it returns a failure, then you should set the
  arraycollection to an empty arraycollection on failure
  
  
  
  
  
  From: flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  mailto:flexcoders%
40yahoogroups.com
 
 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com  mailto:flexcoders%
40yahoogroups.com
 ] On
  Behalf Of jovialrandor
  Sent: Saturday, April 05, 2008 9:16 AM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
mailto:flexcoders%
40yahoogroups.com 
  Subject: [flexcoders] How can I clear an ArrayCollection or 
 Datagrid
  
  
  
  I use a HTTPService to load data into an ArrayCollection which is 
 used 
  for a datagrid. For example I type in a parameter A to the 
  HTTPService that returns data that gets loaded in to 
 ArrayCollectin.
  
  However when I when resend the HTTPservice with parameter B that 
  returns no data, the datagrid still displays the value of 
 parameter A.
  
  I've tried:
  
  httpservice.send(); // To get new values
  arraycollection.refresh(). // To refresh the datagrid.
  
  But no luck.
  
  Thanks
 


 



[flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-07 Thread Dmitri Girski
--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 I ran a simple test of DataGrid binding to arraycollection.  If I set an
 empty array collection, the DataGrid resets properly.

well, I am pretty sure it did not work with AdvancedDataGrid - it was
a first time I've bumped into this problem.
It was AdvancedDataGrid from a Flex3 Beta 2 when I discovered it.

Dmitri.



 
  
 
 If the HTTPService returns an empty ArrayCollection I would expect the
 DG to also reset, but I don't have time to test that out.  If it returns
 null, I'm not sure what it will generate, but again, if you detect that
 it returns null and set the array collection to an empty array
 collection it should reset the DG.
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Dmitri Girski
 Sent: Monday, April 07, 2008 8:22 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid
 
  
 
 Hi Alex,
 
 I believe that there is a bug/feature with binding HTTPService result
 to a DataGrid. If HTTPService returns empty result (null), DataGrid
 won't be cleared from a previous values.
 
 To overcome this problem I had to use a dataProvider
 variable(ArrayCollection) which I clear every time before the request
 and then copy values from HTTPService.
 
 Before this topic I thought that this is feature, but after I saw your
 comments it is definitely a bug :)
 
 PS I have not found any other way of resetting the DataGrid. If you
 assign dataProvider to an empty ArrayCollection it won't help
 (presumably because DataGrid needs collectionChange event and nothing
 else)
 
 Cheers,
 Dmitri.
 
 
 --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 , Alex Harui aharui@ wrote:
 
  If the service returned an empty AC, I would verify that the DG has
  really been assigned that empty AC. Read back the dataProvider on the
  DG and see what its length is. You can also try to manually reset the
  DG to an empty AC and see if it refreshes that way.
  
  
  
  
  
  From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 ] On
  Behalf Of jovialrandor
  Sent: Sunday, April 06, 2008 5:13 PM
  To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
  Subject: [flexcoders] Re: How can I clear an ArrayCollection or
 Datagrid
  
  
  
  Alex, the HTTPService returns an empty arraycollection, but the 
  datagrid still has the values from the last call.
  
  How do I in the code refresh the arraycollection, since the 'refresh
  ()' did not work?
  
  Thanks
  
  --- In flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  , Alex Harui aharui@ wrote:
  
   I would think that your service should return an empty array 
  collection,
   or return a failure. If it returns an empty array collection it 
  should
   refresh. If it returns a failure, then you should set the
   arraycollection to an empty arraycollection on failure
   
   
   
   
   
   From: flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  
  [mailto:flexcoders@yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com
  ] On
   Behalf Of jovialrandor
   Sent: Saturday, April 05, 2008 9:16 AM
   To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 mailto:flexcoders%40yahoogroups.com 
   Subject: [flexcoders] How can I clear an ArrayCollection or 
  Datagrid
   
   
   
   I use a HTTPService to load data into an ArrayCollection which is 
  used 
   for a datagrid. For example I type in a parameter A to the 
   HTTPService that returns data that gets loaded in to 
  ArrayCollectin.
   
   However when I when resend the HTTPservice with parameter B that 
   returns no data, the datagrid still displays the value of 
  parameter A.
   
   I've tried:
   
   httpservice.send(); // To get new values
   arraycollection.refresh(). // To refresh the datagrid.
   
   But no luck.
   
   Thanks
  
 





[flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-06 Thread hworke


  I also do have same kind of problem. But I never tried to
  refresh the array collection. I tied a button to the Httpservice
  and once the array is populated if you press the button,
  which send the httpservice request, all the data disappear.
  Now if you press the button second time, that means send the
  httpservice request second time, the data shows up with
  the updated values.

  I guess what Alex said is happening in my case. When I first
  press the button, httpservice returns an empty arraycollection,
  but when the button is pressed the second time it returns the
  updated array. But one thing I do not understand- why would
  it return empty arraycollection? When I coded I expected it to
  remove all the elements from the array collection and the put
  the new httpservice request's return result


--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 I would think that your service should return an empty array collection,
 or return a failure.  If it returns an empty array collection it should
 refresh.  If it returns a failure, then you should set the
 arraycollection to an empty arraycollection on failure
 
  
 
 
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of jovialrandor
 Sent: Saturday, April 05, 2008 9:16 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How can I clear an ArrayCollection or Datagrid
 
  
 
 I use a HTTPService to load data into an ArrayCollection which is used 
 for a datagrid. For example I type in a parameter A to the 
 HTTPService that returns data that gets loaded in to ArrayCollectin.
 
 However when I when resend the HTTPservice with parameter B that 
 returns no data, the datagrid still displays the value of parameter A.
 
 I've tried:
 
 httpservice.send(); // To get new values
 arraycollection.refresh(). // To refresh the datagrid.
 
 But no luck.
 
 Thanks





[flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-06 Thread jovialrandor
Alex, the HTTPService returns an empty arraycollection, but the 
datagrid still has the values from the last call.

How do I in the code refresh the arraycollection, since the 'refresh
()' did not work?

Thanks

--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 I would think that your service should return an empty array 
collection,
 or return a failure.  If it returns an empty array collection it 
should
 refresh.  If it returns a failure, then you should set the
 arraycollection to an empty arraycollection on failure
 
  
 
 
 
 From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On
 Behalf Of jovialrandor
 Sent: Saturday, April 05, 2008 9:16 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] How can I clear an ArrayCollection or 
Datagrid
 
  
 
 I use a HTTPService to load data into an ArrayCollection which is 
used 
 for a datagrid. For example I type in a parameter A to the 
 HTTPService that returns data that gets loaded in to 
ArrayCollectin.
 
 However when I when resend the HTTPservice with parameter B that 
 returns no data, the datagrid still displays the value of 
parameter A.
 
 I've tried:
 
 httpservice.send(); // To get new values
 arraycollection.refresh(). // To refresh the datagrid.
 
 But no luck.
 
 Thanks





RE: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

2008-04-06 Thread Alex Harui
If the service returned an empty AC, I would verify that the DG has
really been assigned that empty AC.  Read back the dataProvider on the
DG and see what its length is.  You can also try to manually reset the
DG to an empty AC and see if it refreshes that way.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jovialrandor
Sent: Sunday, April 06, 2008 5:13 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How can I clear an ArrayCollection or Datagrid

 

Alex, the HTTPService returns an empty arraycollection, but the 
datagrid still has the values from the last call.

How do I in the code refresh the arraycollection, since the 'refresh
()' did not work?

Thanks

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Alex Harui [EMAIL PROTECTED] wrote:

 I would think that your service should return an empty array 
collection,
 or return a failure. If it returns an empty array collection it 
should
 refresh. If it returns a failure, then you should set the
 arraycollection to an empty arraycollection on failure
 
 
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

[mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
] On
 Behalf Of jovialrandor
 Sent: Saturday, April 05, 2008 9:16 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] How can I clear an ArrayCollection or 
Datagrid
 
 
 
 I use a HTTPService to load data into an ArrayCollection which is 
used 
 for a datagrid. For example I type in a parameter A to the 
 HTTPService that returns data that gets loaded in to 
ArrayCollectin.
 
 However when I when resend the HTTPservice with parameter B that 
 returns no data, the datagrid still displays the value of 
parameter A.
 
 I've tried:
 
 httpservice.send(); // To get new values
 arraycollection.refresh(). // To refresh the datagrid.
 
 But no luck.
 
 Thanks