Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I was wondering if there's a way to display a link in an ApexPages.Message. There's nothing mentioned in the documentation about it, so I simply did a :

ApexPages.Message(ApexPages.Severity.CONFIRM, '<a href="/">test</a>');

It seems like the special characters are transformed to their html entity, making the link unusable.

Any known workaround?

share|improve this question

1 Answer 1

up vote 12 down vote accepted

You may need to set escape parameter to false in your VF page.

<apex:pageMessages escape="false"/> 
share|improve this answer
    
Super cool, never heard of that attribute. Working surprisingly well :D! Thanks @richard-n –  jpmonette Feb 25 '13 at 17:56
2  
Note that this means any HTML included in your ApexPages.Message objects will be rendered as HTML in the page, and if you have to undergo security review you may be asked to justify this choice. –  ca_peterson Feb 26 '13 at 1:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.