views:

26

answers:

2

Hello.

I have the next component, which is substituted into the data grid as rendered item.

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" click="navigateToURL(new URLRequest('{data.GetLink()}'), '_blank');">

The problem with click event, it doesn't work.

How correctly to make navigation VBox that url is substituted from the dataProvider collection?

Thank you!

A: 

The click event isn't getting called at all? It should. Try putting a trace() statement in there.

Once you see the trace() statement, put a hard-coded url in there for testing: click="navigateToURL(new URLRequest('http://google.com'), '_blank');"

After that, change GetLink() to a property in the 'data' object: like data.link

99miles
Yes, you are right. Click event fire, but it with wrong url, link not substitute.With hard-coded url it works good.This code works great:<mx:Text id="title" width="100%" fontWeight="bold" text="{data.GetTitle()}"/>
RollingStone
A: 

I may be wrong but do you have a click event already registered with the datagrid? If so then the event from the child will be canceled out...

onekidney
No, I haven't. _
RollingStone