When using RichFaces’ <a4j:support> to reRender components in the view upon an event, I’ve come across an XML parsing error in the AJAX response which prevents the refresh from completing. The AJAX progress indicator icon continues into infinity despite the request completing its cycle, albeit in an error state. Firebug’s panel indicates the issue is “duplicate attribute”, where I track down the id=”” attribute as being added twice to at least one of the components being redrawn.

I’ve never been able to break the problem down to a simplified example that I can submit to RichFaces’ JIRA tracking system (or just fix myself) because it seems to be very context specific. Once, the duplicate id=”” was added to <rich:calendar>, despite that component rerendering fine on another page when auto-refreshing one date dependent on a birth date field. Another time, it occurred within <h:selectOneRadio>, but only to the first <f:selectItem> child, with a “:0″ added to the end of the second id=”” added to the component tree’s problem node. I find the problem component is usually the first item rerendered within the list of ids passed to the reRender=”” attribute of <a4j:support>.

The solution I’ve used to fix the problem is ad-hoc and likely won’t always work: reRender another level up in the component tree. It will take longer for more components to redraw themselves by possibly causing more retrievals from the persistence layer but at least that obtuse programming error buried within RichFaces’ codebase disappears.