I am having the same problem. I can clear out the TileList by setting
the dataProvider to new ArrayCollection(), but it still retains some
information about the old dataset. I think it is remembering the
total number of items.
This is what I am doing.
1) bind the TileList dataProvider to an ArrayCollection
2) run a filter on the bound ArrayCollection to limt the results to 3
3) apply a different ItemRenderer to the TileList
Every time I run those steps I get this error:
[ERROR]
TypeError: Error #2007: Parameter child must be non-null.
at flash.display::DisplayObjectContainer/removeChild()
at
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$removeChild()
at mx.core::UIComponent/removeChild()
at
mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::updateDisplayList()
at
mx.controls.listClasses::TileBase/mx.controls.listClasses:TileBase::updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/::validateDisplayList()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()
[/ERROR]
I am thinking that the issues is that removeChild() is being called on
items that no longer exist in the TileList. For some reason when
changing ItemRenderers from one to anouther a process runs removeChild
()on all the existing items in the TileList and it thinks there are
more items then there actually are.
Anyone find a fix to this issue?
thanks
--jason
--- In [email protected], Webdevotion <[EMAIL PROTECTED]> wrote:
>
> Please look into my example more closely.
> When you click the button I first clear the list and then fill it
again with
> new items from an arraycollection ; )
>
> collection = new ArrayCollection(); // clears the list
> collection = new
>
ArrayCollection({first:john},{first:john},{first:john},{first:john},{first:john});
> // this line fills the list again, after it was cleared
>