How to Show Links in ADF Messages
Join the DZone community and get the full member experience.
Join For FreeIn ADF we show popup/inline messages using af:messages
tag or popup messages using af:document
. The actual code which populates the message is:
acesMessage 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);
Published at DZone with permission of Mohamed Sanaulla, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Trending
-
What to Pay Attention to as Automation Upends the Developer Experience
-
Constructing Real-Time Analytics: Fundamental Components and Architectural Framework — Part 2
-
10 Traits That Separate the Best Devs From the Crowd
-
File Upload Security and Malware Protection
Comments