How to change text color to p: growl according to severity?

Do I need to change the color of the text to <p:growl>depending on the severity of any idea?

I add a soft growl to this method:

public void addMessageGrowl(Severity typeMessage, String detailMessage) {
     FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(typeMessage, "", detailMessage));
}

After calling this method:

addMessageGrowl(FacesMessage.SEVERITY_FATAL, "Ocurrió un error al ejecutar la operacion");

However, I want to adjust the text color to a growl.

+1
source share
3 answers

If you just want to change the color of the text, you can do this initially with the sibbling CSS selector:

.ui-growl-image-info ~ .ui-growl-message {
    color:#0f0;
}
.ui-growl-image-error ~ .ui-growl-message {
    color:#f00;
}
.ui-growl-image-warn~ .ui-growl-message {
    color:#00f;
}
.ui-growl-image-fatal~ .ui-growl-message {
    color:#000;
}

If you want to change the background, you need something at the link posted by @ ÖmerFarukKurt:

Dynamic color change PrimeFaces

+2
source

, ! ( )

PrimeFaces ( )

, .

+2

you can solve this link below

Dynamic color change PrimeFaces

+1
source

All Articles