Is there such a thing as inheritance in JSF 2 composite components?
As far as I know, there isn’t.
I’m just making sure.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Inheritance of composite components is not possible afaik. What we did to avoid code duplication is to decorate the implementation of a JSF2 composite component.
The stuff shared by all input fields of our application is provided within a decorator template like this:
And the composite component uses the template to decorate itself:
This way we only need to change the decorator template, when the way we fetch field properties (i.e. readonly, required, style,…) changes.