Craig McClanahan wrote:
Going back to the original question, the reason for UIData to deal with
grandchildren directly is explicity described in the javadocs quoted
earlier -- it allows UIData to perform the iteration over the underlying
data model. Among other things, that means UIData actually calls things
like processDecodes() *multiple* times on the same grandchildren ...
once per row. UIColumn doesn't get involved in this at all, other than
being a container for the contents of the grandchildren that will be
rendered inside that column zero or more times (indeed, it doesn't even
have a renderer).
I agree that MyFaces is implementing the logic as defined in the Sun RI
javadoc, so there is no "bug" for MyFaces to fix.
But *why* is UIData.processDecodes defined in such an odd way?
I agree that individual components that are rendered within table cells
(h:outputText, h:inputText, etc) should be isolated from the fact that
they are in a table.
However, why can't UIData call processDecodes on each UIColumn once for
each row? The UIColumn would then simply call processDecodes on each of
its children in turn. The end result would be, as far as I can tell,
identical to the current definition except that the UIColumn is
responsible for invoking processDecodes on its children rather than the
UIData accessing them directly. Won't the leaf components see the same
calls, regardless of whether it is the UIColumn or the UIData that calls
them? I must be missing something but can't see what.
On a related topic, is there any documentation on why UIData is
specified to process only UIColumn children? What other kind of children
could be valid inside a table? Using "instanceof" is generally pretty
poor taste in OO software and I can't see the justification for it here.
It seems so much easier to specify that UIData just calls
"processDecodes" on *every* child it has, once per row in the table.
Regards,
Simon