Does anyone know whether cc.parent is supposed to work for composite
components? Section 5.6.2.2 of the spec combined with the javadocs for
UIComponent.getCompositeComponentParent() seems to indicate that it should.
So it's either a spec or implementation bug. Either way, it should be fixed.
It used to work with Mojarra 2.0, but it no longer works with Mojara 2.0.2.
david
2010/2/2 David Geary <clarity.training(a)gmail.com>
2010/1/29 Cay Horstmann <cay(a)horstmann.com>
I can't get cc.parent to work, and I stared at it for long enough that I am
> pretty convinced that it is a bug. (
>
https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1529)
>
> What I am wondering in this forum is whether cc.parent is actually
> intended to be supported. There was some use case in the olden days, when cc
> was dynamically scoped, but around September 15, Andy Schwarz convinced you
> all that it should be statically scoped. For all I know, that took away the
> raison d'être for cc.parent.
>
> Or is there another use case? I only found one other example, David
> Geary's developerWorks article (
>
http://www.ibm.com/developerworks/java/library/j-jsf2fu2/index.html). He
> has a map component inside a place component that retrieves the location
> from the parent. I am not even sure that's good practice. It doesn't make
> the map component reusable, but instead couples it with the parent.
>
It's true that the example may be a little contrived, but that does not
mean there are no use cases for tightly coupling nested components to parent
components, just as there are plenty of use cases in OO in general for tight
coupling, even though in general, loose coupling is typically preferred. So
IMO, cc.parent makes perfect sense.
david
> Thanks,
>
> Cay
>
> --
>
> Cay S. Horstmann |
http://horstmann.com | mailto:cay@horstmann.com
>