Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0
-
Component/s: ICE-Components
-
Labels:None
-
Environment:ICEfaces 2 + MyFaces 2
-
Assignee Priority:P2
-
Affects:Documentation (User Guide, Ref. Guide, etc.), Compatibility/Configuration
-
Workaround Exists:Yes
-
Workaround Description:
Description
When using ICEfaces with Mojarra, we override the message and messages rendering to wrap the output in a div, so that when we transition between having zero messages and any number of messages, or back, then we won't get dom differencing propagation. We accomplish by extending the Mojarra renderers, and adding the div behaviour. This doesn't work in a MyFaces environment. If MyFaces doesn't adopt our suggestion of adding the div themselves to their own renderers, then we should find a way of providing this functionality with that JSF environment.
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.