Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does composite component "rendered" attribute throw an IllegalArgument Exception?

I create a composite component like this:

<cc:interface>        
    <cc:attribute name="value" 
                  required="true" />
    <cc:attribute name="rendered"
                  displayName="True to render"
                  default="true" />
</cc:interface>

When I invoke this component, I get an IllegalArgumentException. I can changed the rendered name to something else (like doIt) and then it works.

Is the rendered attribute reserved somehow? I want my composite component to look like "regular" JSF components.

This is with Mojarra.

like image 904
AlanObject Avatar asked Nov 12 '11 17:11

AlanObject


1 Answers

Composite components extend UINamingContainer which in turn extend UIComponentBase which in turn already definies the id and rendered attributes. You don't need to specify them yourself. Just remove the <cc:attribute name="rendered">. If you specify the rendered attribute on the composite component tag, then it'll be interpreted and applied on the composite component itself.

If you intend to render specific children of the composite, then better invent a different attribute name. For example, renderSomeChild.

like image 134
BalusC Avatar answered Sep 23 '22 13:09

BalusC