Ok I will leave it in then, thanks for the quick answer on this.
Werner
Catalin Kormos schrieb:
Hi,
I think checking for Resource.COMPONENT_RESOURCE_KEY in the attributes
of the component is the right way. Checking in the RI source code, they
do it the same; of course, this attribute must be set by corresponding
facelets handler when instantiating the composite component from a given
resource, but I think this is also a requirement for composite
components, to associate the component with the actual resource it was
created from.
regards,
Catalin
On Mon, Jun 15, 2009 at 2:02 PM, Werner Punz <[email protected]
<mailto:[email protected]>> wrote:
Hello
Since I am implementing this part, I have a question especially to
the guys doing the facelet part.
We have a method in UIComponent - isCompositeComponent
Now it is not very clear to me if the code I found in our class is
correct.
We already have a private method: _isCompositeComponent which does
following:
private boolean _isCompositeComponent() {
return getAttributes().get(Resource.COMPONENT_RESOURCE_KEY)
!= null;
}
This looks somewhat strange to me, the component resource key,
which is : javax.faces.application.Resource.ComponentResource
is this really an indicator for a composite component?
In my opinion it should look like following:
private boolean _isCompositeComponent() {
component.getRendererType().equals("javax.faces.Composite");
}
but I am not totally sure either, this should work for java based
components which are marked as composite in their renderers, but i
am not sure if this triggers the correct behavior for facelets.
In either case for now I have moved the private code to the public
static method like the spec says!
Werner
--
------------
Codebeat
www.codebeat.ro <http://www.codebeat.ro>