JSF 1.2 doesn't offer a way to visit the tree in a consistent way. Many users of
JSF have tried to go through the JSF component tree to implement some
functionality one way or the other (the RI is no exception, see the other bug I
opened on restoring the component binding).
What I'd love to see (similar to the invokeOnComponent method added in 1.2) is a
tree visitor being able to go through the tree and execute a callback method for
every component found. As an example for a use-case, look at the comment on
- Enhance form renderer to emit some code that scans
down the validators attached to fields on that form,
ones it recognizes, if the page author requests this.
How will you go through each of the fields of the form, if you don't implement
the visitor pattern?