+ Start a Discussion
TejTej 

command link in apex error message

can we put a commandlink in apex error message?

when user gets an error message it contain a clickable content/commandlink ,which should open a popup with instructions.

is it possible to add commandlink in errormessage??
logontokartiklogontokartik
Yes you can.
On your <apex:pageMessages id="theMessages" escape="false"/> make sure you add escape="false" and in your controller when you add Error
on ApexPages.addMessage you can use HTML Text.
Something like 
String htmlText = 'Case successfully created <a href="#" id="'+newCase.Id+'" class="newCaselink">View Case</a>';

		ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, htmlText));


TejTej
can we add an action method? and on click of the link it opens a popup?