There are a couple of things to note here:
1) Currently, the way that the ViewState is updated when running with MyFaces leads to unnecessarily large updates - particularly with the initial Ajax request. I've spun off a separate JIRA to cover this case: ICE-7091. The reason to referring to it here is that the updates caused by the h:message(s) renders are difficult to diagnose due to the problem with the large initial form update.
2) Both the h:message and h:messages tags will not render anything if an "id" attribute is not provided. When a request triggers a message, the resulting change to the DOM will trigger a DOM diff. Without a uniquely identified "container" to replace, the resulting DOM diff will target the form or even the body as the updateable region resulting in larger than necessary updates.
3) By adding an "id" attribute:
h:message will render a <span id=... />
h:messages will render a <div id=... />
A subsequent request that contains a message to display will work properly for h:message because the <span> is updated with a <span>. For h:messages, simply adding an id does not help as the <div> is replaced by a <ul> which leads to a search up the DOM to find a suitable parent to replace. So adding an "id" to an h:message is a suitable workaround but not for h:messages.
There are a couple of things to note here:
1) Currently, the way that the ViewState is updated when running with MyFaces leads to unnecessarily large updates - particularly with the initial Ajax request. I've spun off a separate JIRA to cover this case:
ICE-7091. The reason to referring to it here is that the updates caused by the h:message(s) renders are difficult to diagnose due to the problem with the large initial form update.2) Both the h:message and h:messages tags will not render anything if an "id" attribute is not provided. When a request triggers a message, the resulting change to the DOM will trigger a DOM diff. Without a uniquely identified "container" to replace, the resulting DOM diff will target the form or even the body as the updateable region resulting in larger than necessary updates.
3) By adding an "id" attribute:
h:message will render a <span id=... />
h:messages will render a <div id=... />
A subsequent request that contains a message to display will work properly for h:message because the <span> is updated with a <span>. For h:messages, simply adding an id does not help as the <div> is replaced by a <ul> which leads to a search up the DOM to find a suitable parent to replace. So adding an "id" to an h:message is a suitable workaround but not for h:messages.