문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top