You need to sign in to do that
Don't have an account?
benburb
Escape html in apex:messages?
I'm trying to show all the errors in my VisualForce page using my own styling, so I include <apex:messages> at the top of the page (instead of <apex:pageMessages>) and add the appropriate styleClass attribute. It's working fine (was guided by http://salesforce.stackexchange.com/questions/8139/difference-between-the-multiple-messaging-options-in-visualforce).
Now I have a requirement to include a hyperlink in an error message itself, yet the 'escape='false'" attribute available in <apex:pageMessages> is not available in <apex:messages>.
Do I really have to choose between Salesforce styling with the ability to hyperlink an error message, my own styling without that ability, or rolling my own error messaging from scratch? Hoping I'm missing something.
Thanks for any ideas!
Now I have a requirement to include a hyperlink in an error message itself, yet the 'escape='false'" attribute available in <apex:pageMessages> is not available in <apex:messages>.
Do I really have to choose between Salesforce styling with the ability to hyperlink an error message, my own styling without that ability, or rolling my own error messaging from scratch? Hoping I'm missing something.
Thanks for any ideas!
<a href='URL'> <apex:messages/></a>
Here URL means a return url where you want to show some data regarding an error message.
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, 'That child is too old for the class. Click <a href="www.company.com/policy.html">here</a> to review our policies.');
ApexPages.addMessage(msg);
using <apex:messages> (works fine with <apex:pageMessages escape="false">).
follow this link which might be usefull for your question.
http://salesforce.stackexchange.com/questions/51072/what-controls-the-severity-of-apexpages-addmessagesexception
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, 'That child is too old for the class. Click <a href="www.company.com/policy.html">here</a> to review our policies.');
ApexPages.addMessage(msg);
I have similar requirements.