After a user add an item to the cart successfully, I'd like to display a message like Click here to continue shopping and Click here to view your cart using <p:message> or <p:growl>.
I tried to google with keywords like PrimeFaces how to put hyperlink into <p:message> but nothing meaningful showed up. Hence, I'd be very grateful if you could share with me how to do this or if it's even possible.
According to the following blog post : FacesMessage Enhancements
You can use escape="false"
<p:message escape="false" />
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
"Sample warn message", "PrimeFaces is developed by
<strong>Chuck Norris!</strong>"));
Or
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
"Sample warn message", "Some Link
<a href='http://www.w3schools.com/'>Visit W3Schools</a>"));
You could also take a look at this article by BalusC
Using HTML in JSF messages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With