Anything you put in {} causes generated code that eats all errors.
 
A renderer shouldn't count on the data object not being null. so I'd do:
 
if (data)
    trace(data.publ)

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of oneproofdk
Sent: Tuesday, December 18, 2007 1:04 AM
To: [email protected]
Subject: [flexcoders] Re: DataGrid ItemRenderes - How to access the
{data} from the datagrid



Hi Alex

Thanks for your reply.

I propably missed something here... but when I use {data.} in mxml it
works. But when I make a script tag that should adjust properties etc.
it says "null value" - here's my code:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
paddingLeft="16" horizontalAlign="center"
creationComplete="init()"> 
<mx:Script>
<![CDATA[
public function init() : void
{
trace (data.publ);
}
]]>
</mx:Script>
<mx:Label id="lblStatus" name="lblStatus" text="{data.publ}"/> 
</mx:VBox>

<<TypeError: Error #1009: Cannot access a property or method of a null
object reference.>> right at the trace statement

Why do I get this error ?

Thanks for your time.

Mark

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> It should just be the .data property. What did you try? However, I'd
> look at the examples on my blog (blogs.adobe.com/aharui). You probably
> don't need to use VBox which is pretty heavy.
> 



 

Reply via email to