How to show links in ADF Messages

In ADF we show popup/inline messages using af:messages tag or popup messages using af:document. The actual code which populates the message is:

FacesMessage fMsg = new FacesMessage("Some Message");
FacesContext fContext = FacesContext.getCurrentInstance();
fContext.addMessage("",fMsg);

The above code shows the message at INFO Severity. What if we want to add a link in the message we show? For that we would have to wrap the complete message within html tags. Let modify the above message to add a link to some webpage.

String htmlMessage = "<html>Some Message. "+
           "Goto <a href=http://www.google.com>Google</a></html>";
FacesMessage fMsg = new FacesMessage(htmlMessage);
FacesContext fContext = FacesContext.getCurrentInstance();
fContext.addMessage("",fMsg);

HtmlMsg

NormalMsg
This is one of the ways to show any links in your messages.

1 thought on “How to show links in ADF Messages”

Leave a Reply

Discover more from Experiences Unlimited

Subscribe now to keep reading and get access to the full archive.

Continue reading