Flex uses an invalidation mechanism.  This is the most efficient way to
handle multiple property changes at once which is common at startup and
in other scenarios.  As such, when you set a property like the
dataprovider, related properties like rowHeight are not validated until
much later, when the validation system kicks in.  You can force
validation by calling validateNow() which is expensive, or you can wait
until later (via callLater or waiting for updateComplete event).

 

-Alex

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of oneproofdk
Sent: Monday, October 22, 2007 11:49 PM
To: [email protected]
Subject: [flexcoders] Re: What EVENT should I capture - Tilelist "data
loaded / All tiles created" ?

 

Hi Alex

Thanks for your reply.

I use a function that receives the data from httpservice, this
function set the dataprovider for the tilelist, which in turns gets
popuplated by itemrenderers. What I need is a way to measure how many
rows @ what height the data actually rendered in the tilelist.

I use the following function - which returns strange values, the
rowheight returned is only 2 - in fact it's 200.

I there an event that gets fired when it has completed rendering the
data ?

private function jsonGetPages(event:ResultEvent):void
{
var rawData:String = String(event.result);
var arr:Array = (JSON.decode(rawData) as Array);
var dp:ArrayCollection = new ArrayCollection(arr);
//projectPages = dp;
var fileid:int = dp[0].fileid;
var curTab:TabNavigator = objArray['tabnav'+dp[0].fileid];
var curTile:TileList = objArray['tilelist'+dp[0].fileid];
curTile.dataProvider = dp;
curTab.height = curTile.rowHeight * curTile.rowCount;
trace( 'rowHeight:'+ curTile.rowHeight );
}

Again - thanks alot for your reply.

Mark

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> updateComplete fires every time it redraws. The dataprovider fires
> collectionChange when it changes
> 

 

Reply via email to