Widget inheritance

Widget inheritance

In order to explore if the "new" widget factory can and should make it into 1.8, I built an extremely simplified accordion widget that inherits from a panel widget: <a href="http://jquery-ui.googlecode.com/svn/branches/labs/widget-factory/tests/visual/inheritance.html"> http://jquery-ui.googlecode.com/svn/branches/labs/widget-factory/tests/visual/inheritance.html</a>
The interesting part is the click method, which accordion overwrites (and doesn't call super).  For init and destory its just delegating to panel; the method stubs just indicate where additional init/destroy code would be placed.
Please keep in mind that while inheritance is useful in this case, the much preferred approach to building widgets based on other widgets is composition, like in the combobox case: <a href="http://localhost/jquery-ui-dev/tests/visual/autocomplete/combobox.html">http://localhost/jquery-ui-dev/tests/visual/autocomplete/combobox.html</a>
What do you think?
Jörn


--