With JSF-Primefaces how can I make a link on a dataTable column for emailId, such that onclick will open an email compose window? I'm using Primefaces.3.0.M3 with JSF2.
Use the HTML standard mailto:
link syntax. You just need to make sure that the generated HTML link ends up to look like
<a href="mailto:[email protected]?subject=Some%20subject&body=Some%20body">mail</a>
This can in JSF be achieved by for example
<h:outputLink value="mailto:#{user.email}">
<f:param name="subject" value="Some subject" />
<f:param name="body" value="Some body" />
<h:outputText value="mail" />
</h:outputLink>
Those links will open the client's default mail composition editor. The subject
and body
parameters are optional and allows you to set a default subject and body in the email editor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With