以下方式可實現跳行的需求
Controller :
public class LineBreakController
{
public String str{get;set;}
public LineBreakController()
{
str = 'This is Line 1 \n This is Line 2'; //Your Error Message.
}
}
VisualForce Page :
<apex:page controller="LineBreakController">
<apex:pageMessage summary="{!SUBSTITUTE(JSENCODE(str ), '\\n', '<br/>')}" severity="warning" strength="3" escape="false" />
沒有留言:
張貼留言