In the RichFaces components "input" project, I want to take the rf.ui.PopupList javascript object, and split some of the funtionality out for code re-use. Specifically, I want to re-use the list part, and refactor out the popup part. The problem is the ojbect currently extends the rf.ui.Popup object.

rf.ui.Popup.extend(rf.ui.PopupList); [1]

JQuery's extend method (on which the above extend is built) supports multiple inheritence. So I thought I could create a new object called rf.ui.List, and have PopupList extend both these objects, as in:

My first attempts with this have proven so far to be unsuccessful. Beofre I spend much more time trying to make it work, I'd appreciate hearing if others think this is possible, and if so, wheteher it's a good approach. I'd particularly like to find somewhere in the exisitng codebase where this is already done.

And I have list.js that contains all the previous popuplist javascript (except the default options). Thus, PopupList extends Popup to get the popup functionality, but PopupList is composed of a rf.ui.List object, which can in turn be used to build other components.