简体   繁体   中英

How to show PrimeFaces messages through p:messages without icon?

FacesContext.getCurrentInstance()
            .addMessage("value", 
                 new FacesMessage(FacesMessage.SEVERITY_ERROR, "you can't input this value", ""));
<p:messages for="value"
            showDetail="false"
            autoUpdate="true"
            display="text"/>

Hi everybody! It works great but I want to show only text message without icon. How to resolve this? screenshot

在此处输入图片说明

I am using PrimeFaces 4.0 (where setting the showIcon attribute to false is not an option).

You could potentially write something like this:

FacesContext.getCurrentInstance().addMessage("value",   new FacesMessage("you can't input this value", ""));

Just remove this: FacesMessage.SEVERITY_ERROR,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM