• Post Reply Bookmark Topic Watch Topic
  • New Topic

How can use heritage in XHTML and Expression language.

 
Ousmane Mbinte
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my Icefaces 3 application I have a ManagedBean ancestor that defines common attributes to those they spread it. Including CSS styles to be apply at the menu as icons depending on whether they are selected or not. Classes that extend the CommonMBean class define styles. My question is what do I have to put in the language experssion styleClass to tell him that the getter to use is that of the parent class.

CommonMBean.java



FirstMBean.java



SecondeMBean.java




XHTML file :

 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not "heritage", the technical term that applies here is "inheritance". There's probably a slightly different set of meanings to the word "heritage" in French, but technical English isn't always "English" anyway.

Whenever you want a class to inherit attributes of a parent class, you don't have to do anything other than have suitable visibility. So:



This is general Java and JSF does not vary from it in any way.

The one case where inheritance can be tricky is in the inheritance of annotation-based properties. Some annotations can be inherited, some cannot and only reading their documentation will tell which is which.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!