Why does the composite component of a “rendered” attribute throw an IllegalArgument exception?

I create a composite component as follows:

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

When I call this component, I get an IllegalArgumentException. I can change the display name to another (e.g. doIt ) and then it works.

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

This is with Mojarra.

+6
source share
1 answer

Composite components extend the UINamingContainer , which in turn extends the UIComponentBase , which in turn already defines the id and rendered . You do not need to specify them yourself. Just remove the <cc:attribute name="rendered"> . If you specify the rendered attribute in the tag of a composite component, it will be interpreted and applied to the composite component itself.

If you want to display specific child elements of a composite, better think of a different attribute name. For example, renderSomeChild .

+14
source

Source: https://habr.com/ru/post/901353/


All Articles