Not rowHeight or columnWidth explicitly. There may be some implicit calls to
it, however -- I am setting rowCount and columnCount. Here is the complete
file (it's really short) -- I previously only posted the attempted fix
written based off of your description. Some of these MXML properties may be
redundant, I haven't cleaned up failed attempts to get this to work...

<?xml version="1.0" encoding="utf-8"?>
<mx:TileList xmlns:mx="http://www.adobe.com/2006/mxml"; rowCount="{Math.ceil(
dataProvider.length/10)}" columnCount="10" itemRenderer="SimpleMXMLRenderer"
       borderThickness="0" focusThickness="0" paddingBottom="0"
paddingTop="0" width="100%">
   <mx:Script>
       <![CDATA[
           import mx.controls.Alert;

           public override function set dataProvider(o: Object): void {
               if (this.dataProvider) {
                   this.dataProvider.removeEventListener("collectionChange",
this.cc);
               }

               super.dataProvider = o;
               this.dataProvider.addEventListener("collectionChange",
this.cc);
               this.callLater(this.cc);
           }

           private function cc(event: Event = null): void {
               this.itemsNeedMeasurement = true;
               this.invalidateProperties();
           }
       ]]>
   </mx:Script>
</mx:TileList>

TIA,
Daniel

On 5/18/07, Alex Harui <[EMAIL PROTECTED]> wrote:

 Is it possible you set explicit rowHeight and columnWidth?
commitProperties() should get called followed by makeRowsAndColumn.



-Alex


 ------------------------------

*From:* [email protected] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Daniel Grace
*Sent:* Friday, May 18, 2007 2:22 PM
*To:* [email protected]
*Subject:* Re: [flexcoders] TileList itemRenderer resize



I added the following code to the TileList:

            public override function set dataProvider(o: Object): void {
                if (this.dataProvider) {
                    this.dataProvider.removeEventListener("collectionChange",
this.cc);
                }

                super.dataProvider = o;
                this.dataProvider.addEventListener("collectionChange",
this.cc);
                this.callLater(this.cc);
            }

            private function cc(event: Event = null): void {
                this.itemsNeedMeasurement = true;
                this.invalidateProperties ();
            }

I have added (and since removed, since it was noisy) an alert to my cc
function, so I know that it's getting called when my underlying data gets
changed... but the individual tiles still aren't resizing. I can see the
very top part of the unhidden data in the tiles, but it doesn't expand to
see the rest.

Am I handling this in the wrong place?

TIA,
Daniel

On 5/18/07, *Alex Harui* <[EMAIL PROTECTED]> wrote:

Try setting itemsNeedMeasurement=true and calling invalidateProperties().


 ------------------------------

*From:* [email protected] [mailto: [EMAIL PROTECTED] *On
Behalf Of *Daniel Grace
*Sent:* Friday, May 18, 2007 12:26 PM
*To:* [email protected]
*Subject:* [flexcoders] TileList itemRenderer resize



I am using a mostly default (some options, no subclassing) TileList
with a custom itemRenderer. I have been using the same itemRenderer
for a while with no problems. I made a change to where one of the UI
elements inside of this itemRenderer sets its visible and
includeInLayout to false depending on the underlying data. When this
happens the height of the itemRenderer should change, but the TileList
doesn't seem to realize this.

I am assuming that the TileList does a height/width calculation early
on and doesn't notice that things are different. I am fine with
subclassing, but at this point I don't know where to look for the
right functions/events to latch on to to make this work as I expect.

BTW, I know that the measurements are based off of the first data
element, but because of the way this actual application works all of
its itemRenderers will be the same size -- they just need to change
sizes at runtime sometimes.

TIA,
Daniel





Reply via email to