0

I'm trying to figure out if it's possible to pass values into a backing bean via a JSF composite component. So if I have an interface like this

<composite:interface>
    <composite:attribute name="commentList"/>
</composite:interface>

Can I then assign the value of commentList to a backing bean to do some processing on it?

Bonus question: Can I create a bean localized to this component? Ie, is there a way to create a bean such that it doesn't conflict with other instance of this components?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Mark Robinson
  • 3,135
  • 1
  • 22
  • 37

1 Answers1

0

You can have a so-called backing component which you bind via componentType attribute:

<composite:interface componentType="someComposite">

With

@FacesComponent("someComposite")
public class SomeComposite extends UINamingContainer {
    // ...
}

Yes, each composite instance will obviously have its own backing component instance.

Here are some more concrete real world examples:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555