Yes, your function must be public, and then you can use outerDocument.
convertEmailToMailto() to call it.

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of valdhor
Sent: Tuesday, July 08, 2008 3:21 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Creating a hyperlink mailto in advanced data
grid

 

The problem is that anything inside your <mx:Component> tags are in a
different scope to the rest of the items in the file. You have one
component trying to talk to another component but it can't because the
function is private to the first component.

One fix is to make the function public so that other components can
invoke it.

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, Adrian Williams <[EMAIL PROTECTED]> wrote:
>
> Tracy,
> 
> Thanks for the help!! I have some additional questions on this. I 
> am very new to flex/as and am stuck on a couple items.
> 
> I found some examples on how to setup the renderer and have 
> implemented this. I created a function to create the actual mailto 
> string and have hit these snags:
> 
> Here is the code for the function:
> 
> private function
convertEmailToMailto(emailAddy:String):String
> {
> var mailtoEmailAddy:String ;
> mailtoEmailAddy = '<a href="mailto:' + emailAddy + '">' 
> + emailAddy + '</a>';
> return mailtoEmailAddy;
> }
> 
> And here is the renderer code:
> 
> <mx:itemRenderer>
> <mx:Component>
> <mx:Text 
> htmlText="{convertEmailToMailto(data.emailAddress)}"/>
> </mx:Component>
> </mx:itemRenderer> 
> 
> The first problem I have is that I am getting "call to possibly 
> undefined method convertEmailToMailto" error and am not sure what the 
> problem is. 
> 
> The next is that I am confused about the bubbling. I am assuming 
> I will need to add a 'click=""' in the <mx:Text> line and I see in the

> properties for TextEvent to do a TextEvent:LINK but I am not having a 
> lot of luck seeing how to implement this.
> 
> Help?
> 
> Thanks,
> Adrian 
> 
> Tracy Spratt wrote:
> >
> > There are several ways to do this. One way is to create an 
> > itemRenderer using htmlText. htmlText can include an <a href="" /> 
> > tag. You can have the click dispatch a bubbling TextEvent, and in
the 
> > handler, access the dataProvider item via the event.currentTarget 
> > property, and use the url to build your mailto url, and
navigateToURL 
> > to laouch the browser.
> >
> > 
> >
> > There will be examples of all of this if you look a bit.
> >
> > 
> >
> > Tracy
> >
> > 
> >
> >
----------------------------------------------------------
> >
> > *From:* flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] 
> > *On Behalf Of *Adrian Williams
> > *Sent:* Monday, July 07, 2008 1:04 PM
> > *To:* flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> > *Subject:* [flexcoders] Creating a hyperlink mailto in advanced
data grid
> >
> > 
> >
> > Hi All,
> >
> > I am using an advanced data grid to display a variety of data,
one 
> > of which is a users email address. I'd like to be able to set it up 
> > so that for any given row in the report, the email addresses are 
> > actually hyperlinks to open a mailto: that address. How do I do
this?
> >
> > Thanks,
> > Adrian
> >
> >
>

 

Reply via email to