[flexcoders] Creating a hyperlink mailto in advanced data grid

2008-07-07 Thread Adrian Williams

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


RE: [flexcoders] Creating a hyperlink mailto in advanced data grid

2008-07-07 Thread Tracy Spratt
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:[EMAIL PROTECTED] On
Behalf Of Adrian Williams
Sent: Monday, July 07, 2008 1:04 PM
To: flexcoders@yahoogroups.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

 



Re: [flexcoders] Creating a hyperlink mailto in advanced data grid

2008-07-07 Thread Adrian Williams

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:[EMAIL PROTECTED] 
*On Behalf Of *Adrian Williams

*Sent:* Monday, July 07, 2008 1:04 PM
*To:* flexcoders@yahoogroups.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