Create a message similar to p: messages using PrimeFaces without adding to FacesContext?

I am using Primefaces 2.3.0 and JSF2.0.

I like the html output that gives Primefaces p:messages . But due to the existing design, I would like to create html without adding posts using FacesContext.getCurrentInstance().addMessage .

Essentially, I would like to do something like this:

 <p:messages value="test"/> 

I understand, probably I won’t use p: messages, but the existing tags that will output something very similar to what p: messages produces.

I hope there is another component that uses p:messages .

Thanks for any ideas.

+8
jsf-2 primefaces
source share
1 answer

The most minimalistic example I found looks exactly the same using my theme:

 <div class="ui-message-error"> <span class="ui-message-error-icon"/> <span class="ui-message-error-detail">test</span> </div> 

I removed the ui-widget ui-corner-all classes from the div because I don't use rounded corners, etc., but if that matters in your case, well, the example will be a little longer.

+7
source share

All Articles