0

I need to show email on xPage. I use Icon with "mailto:" link to save space. It works well as clicked - opens new Notes email with clicked address. However when it is copied with "Copy email address" it has %40 instead of @ and users are complaining about that...

Here is the relevant code:

<xp:link escape="true" id="link2">
  <xp:this.value>
    <![CDATA[#{javascript:"mailTo:"+pData.getEmail();}]]>
  </xp:this.value>
  <xp:image id="image3" url="/mail.png" alt="e-mail..."></xp:image>
</xp:link>
Tode
  • 11,795
  • 18
  • 34

1 Answers1

0

Try encoding the email address with URLEncoder.encode():

<xp:link escape="true" id="link2">
    <xp:this.value>
        <![CDATA[#{javascript:"mailto:" + java.net.URLEncoder.encode(pData.getEmail(), "utf-8")}]]></xp:this.value>
    <xp:image id="image3" url="/mail.png" alt="e-mail..."> </xp:image>
</xp:link>
Per Henrik Lausten
  • 21,331
  • 3
  • 29
  • 76
  • Not working as well... If the same info is places into label it shows normally with @ `code` <![CDATA[#{javascript:"mailTo:"+pData.getEmail();}]]> `code` – Niklavs Lacis Oct 05 '16 at 07:15