Also, you don’t use binding braces in AS script:

lstElements.dataProvider = "{catalog.product}"

 

I’d do something like:

var oDPInitial:Object = catalog.product.clone();

 

Then in Reload:

lstElements.dataProvider = oDPInitial;

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Chotin
Sent: Friday, May 06, 2005 12:58 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Reloading Data Question

 

Maybe try doing dataProvider=”{catalog.product.clone()}”.  Basically the problem is that you’re messing with your original dataProvider and deleting everything in it.  You need to pass your TileList a copy of the dataProvider so that you can muck with it without doing permanent damage.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of David Terry
Sent: Friday, May 06, 2005 8:17 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Reloading Data Question

 

Hello,

 

I hope everyone is having a happy Friday.

 

I have another basic question for everyone – How do you reload data into a tileList or in general?

 

So…  I have a tileList that is feed from an XML file.  The user can drag items from the list to a canvas, and I remove the item from the tileList.  There is a button to clear both the tileList and the canvas, but I want to reload the data back into the tileList.  How?  Cuz my code just isn’t working.

 

Many thanks,

~David T.

 

+++++++++++++++++++CODE+++++++++++++++++++++

****My TileList****

<mx:TileList  id="lstElements" dataProvider="{catalog.product}" width="180" height="594"

cellRenderer="lstThumbnail" x="10" y="38" borderColor="#CCCCCC" borderThickness="1"

highlightColor="#FFFFFF" dragEnabled="true" backgroundColor="#FFFFFF"

barColor="#FFFFFF" rollOverColor="#FFFFFF" selectionColor="#F0F0F0"

columnCount="1" borderStyle="solid" itemWidth="160"

dragComplete="doDragComplete(event)" />

 

****My XML File****

<mx:Model id="catalog" source="elements/elements.xml"/>

 

****My Clear & Reload Function****

function ReloadContainers(){

            lstElements.removeAll();

            cvsCanvas.destroyAllChildren();

            lstElements.dataProvider = "{catalog.product}"

           

}

++++++++++++++++END CODE+++++++++++++++++++++

 

 

 



Yahoo! Groups Links

Reply via email to