You need to sign in to do that
Don't have an account?
h20rider
ApexPages.Message with a line break
I have tried adding a string with both a \n and <br>.
The \n does do a line return in the source
and the <br> displays <br> instead if do a br
How can I get it to not encode the <br>
You can use a variable to store the error message and put a apex:outputtext with escape="false" .
In the message add <br> tag for line break this will work.
Controller:
String error;
if (lst.size() < 0)
error = 'No record to display';
VF Page:
<apex:outputtext id="errormessage" escape="false" value="{!error}"/>
Note: make sure you rerender errormessage when you call submit method....
All Answers
You can use a variable to store the error message and put a apex:outputtext with escape="false" .
In the message add <br> tag for line break this will work.
Controller:
String error;
if (lst.size() < 0)
error = 'No record to display';
VF Page:
<apex:outputtext id="errormessage" escape="false" value="{!error}"/>
Note: make sure you rerender errormessage when you call submit method....
thanks. that was it. But instead of
<apex:outputtext id="errormessage" escape="false" value="{!error}"/>
I did
<apex:pageMessages escape="false" />
thanks again
cool man! Yup the key is escape attribute:)