Please consider the following test code:
Error: During update: formId:testTable:0:footerTest not found
This is expected, b/c the correct id for the footer is formId:testTable:footerTest.
The bug is in org.richfaces.context.ComponentIdResolver. Here is what happens:
- The RenderComponentCallback is executed on the input component ('valTest' in the example) and it reads the list of short ids to render from the attached Ajax Behavior. Note that we got here by walking the parent data table model, so the current rowKey is 0
- RenderComponentCallback asks ComponentIdResolver to resolve short ids into client IDs
- ComponentIdResolver starts ascending up the tree from 'valTest' and looking at facets and children until it finds 'footerTest'.
- At this point it asks for the clientId of 'footerTest' w/o regard for the fact that the data model has a rowKey that is set 0
So, we get the wrong id b/c we call UiData.getClientId() outside of the normal walking order of that model.
I noticed that if I nest the above data table in another data iterator, then the footer update suddenly starts working. I investigated and it turned out that nested table will have getClientId() called on all of its components by the parent table, and since clientId s are cached, by the time ComponentIdResolver gets to it, it will use the cached id, rather than looking it up at the wrong time. Non-nested tables simply don't get around to calling getClientId() on their components before ComponentIdResolver runs, which is probably the real problem.
Could it be an issue with the way UIDataAdapter.saveChildState(FacesContext facesContext) is written? Note that a nested table would save the state of its facets in saveChildState(FacesContext facesContext, UIComponent component), which would result in calls to getClientId() on the facet cells. A top level table would not save the state of the facets though, b/c we only traverse the children of the table inside UIDataAdapter.saveChildState(FacesContext facesContext)