I've read dozens of question regarding similar problem, but could not find an answer to it. I've got this piece of code inside a form:
<p:outputPanel id="articleInfo">
<p:growl id="messages" autoUpdate="true"/>
<p:panel rendered="#{not empty myBB.selectedProduct}">
<p:panel>
<h:outputText escape="false" value="#{myBB.content}"/>
</p:panel>
<p:commandButton value="Button" update=":mainForm:articleInfo"/>
</p:panel>
</p:panel>
When I click a button, new content is generated in the backing bean and FacesMessage
is added like this:
public String getContent(){
FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(severity, title, detail));
return "something";
}
The ajax update is fine because I see new content, addMessage
is also called, but I cannot see the message. I've tried p:messages
instead of growl, adding for="mainForm:articleInfo"
and calling the addMessage
with "mainForm:articleInfo" (I've checked that it's the correct ID in the view.
I still cannot find a reason for this.