cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a column with link to an email?

Former Member
0 Kudos

Hello,

I have created a table UI with a certain column that contains email addresses. I would like to turn this column into a link that by pressing it will open new mail message with the default mail editor (In my case it is Outlook).

How do I do that?

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi,

you can use LinkToURL UI element with "reference" property starting with "mailto:" for example - "mailto:me@my.com"

Regards, Maxim R.

Former Member
0 Kudos

Yes but:

1. How do I put LinkToURL inside a column.

2. How do I take the mail address from the Context? You showed me how to hard code it...

former_member182372
Active Contributor
0 Kudos

Hi,

1) LinkToURL can be column editor

2) Create calculted attribute. Lets say you have node with "mail" attribute. Create "mailTo" attribute under node, set it as calculated and in get method put something like this:

return "mailto:" + element.getMail();

Regards, Maxim R.

Former Member
0 Kudos

Hey Maksim,

I'm sorry I am not quite following you.

1. After adding new column editor to an existing table, I don't see an option to set it as LinkToURL. I only see it when creating the wholw table in the wizard but not after creating the table and adding a column and a column editor inside it.

2. I don't understand step 2. If I already have "mail" attribute, why creating mailTo attribute under the same node and how exactly do I set it's value? Do you mean to put inside the attribute the string: return "mailto:" + element.getMail(); ?

Former Member
0 Kudos

1. To set a LinkToURL as table cell editor: In the <b>outline view</b>, select the table column, right-click to open the context menu and choose "Insert table cell editor" (or similar). This should open a dialog where you can select the type of table cell editor. Among these you will find LinkToURL.

2. If you already have a context attribute that stores the mail address, you need an additional (calculated) attribute that returns mailto:<address>. In the get-method generated for this calculated attribute you simply return "mailto:" + <address> as described.

Armin

Former Member
0 Kudos

So why not simply concatenate to the current mail attribute the "mailTo:" String?

And if I understood correctly I should bind this context attribute to the linkToURL's source attribute right?

Former Member
0 Kudos

The property to be bound is LinkToURL.<b>reference</b>.

The calculated attribute provides the concatenation.

Armin

Former Member
0 Kudos

Solved Problem!

Thank you both very much, I gave each one of you the most points I could give...

Answers (0)