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


Reply via email to