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.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With