Christian Schlichtherle
Christian Schlichtherle

Reputation: 3155

How do I bind a composite component in JSF?

I have a composite component which is composed of other composite components. Now I would like to render only some of the child components within the parent component. From the Java EE tutorial I take it that I should probably bind my child components to some property of the backing bean for my parent component so that I can access their render attribute.

However, the NetBeans IDE does not know about a binding attribute for my composite components. So how am I supposed to do this?

Use case: The parent component is some wizard which should display only one of the child components at a time. Think of it as a poor man's tabbed view. I know there are libraries which provide ready-made components for this, but I do not want to add another dependency.

Upvotes: 1

Views: 2122

Answers (1)

BalusC
BalusC

Reputation: 1109655

Netbeans is lying. That attribute is definitely supported on <ui:component>. Just use it and ignore the warning/error in the IDE. Or better, just use the rendered attribute; the need to conditionally render components is not a valid reason to prefer binding over rendered.

Upvotes: 4

Related Questions