I'm trying to test the p:growl and p:messages using the attribute autoUpdate, but it doesn't work, it's a very simple code though.
My page (primes.xhtml):
<h:head/>
<h:body>
<h:form>
<p:messages autoUpdate="true"/>
<p:commandButton action="#{dateBean.testErr}"/>
</h:form>
</h:body>
the DateBean class:
@ManagedBean
public class DateBean {
public String testErr(){
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage("test error"));
return null;
}
}
whenever I hit the commandButton the server gives me the following warning:
"WARNING: There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered. These unhandled FacesMessages are: - test error"
But messages aren't displayed in the page, neither do the growl.
PrimeFaces 7 doesn't support this p:growl and p:messages autoUpdate="true" attribute. Simply it doesn't work, you get the server warning above: "WARNING: There are some unhandled FacesMessages,..."
Use this instead of autoUpdate="true" attribute:
<p:messages>
<p:autoUpdate />
</p:messages>
and this
<p:growl id="growl" showDetail="true" sticky="true">
<p:autoUpdate />
</p:growl>
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With