is possible use two growls in one page
Asked Answered
P

1

0

I want to use two growls in one page. One use to show success message that do auto hide (sticky="false"), the other one use to show failed messages that do not auto hide (sticky="true"):

<p:growl id="globalSuccessMessageGrowl" showDetail="false"
        showSummary="true" life="3000" />

    <p:growl id="globalFailedMessageGrowl" showDetail="false"
        showSummary="true" sticky="true" />

public static void globalSuccessMessage(String message,
        FacesMessage.Severity severity) {
    FacesContext.getCurrentInstance().getViewRoot().findComponent("globalSuccessMessageGrowl"); 
    renderComponent(new FacesMessage(severity, message, message), null,
            "globalSuccessMessageGrowl");
}

public static void globalFailedMessage(String message,
        FacesMessage.Severity severity) {
    renderComponent(new FacesMessage(severity, message, message), null,
            "globalFailedMessageGrowl");
}

...but the two growls do not auto hide after 3 seconds. Failed growl effects success growls?

Pickerelweed answered 9/12, 2013 at 7:53 Comment(1)
Possible duplicate of Show messages based on Severity in two p:growlKoniology
C
1

You can assign different severity levels to each one. This was an attribute added to primefaces in version 3.3.

Check this question . The user had the same problem as you do.

Cocker answered 9/12, 2013 at 8:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.