Accordions to tabs, and back again
Both the accordion and the tabs widgets are containers. That is, their typical use inside the context of an application is to organize subcomponents. These subcomponents might be other widgets, or any other HTML element for that matter. So, both widgets fit the generic description of a container, that is, a widget with different sections. There are obviously subtleties to that description; for example, accordions don't support remote Ajax content. Also, the way users traverse the sections are quite different. Yet, they're essentially interchangeable. Why not introduce the ability to switch between the two widgets, especially during run time where the users can set their own preference and toggle between the two containers? It turns out that we can implement something like this. Let's look at how we would go about doing this. We need a bidirectional conversion between the two widgets. That way, the tabs widget can be transformed into an accordion widget...