public void ready(final YuiContext Y) {
final Console console = Y.newConsole(ConsoleConfig.create() );
console.render();
final HistoryBase history = Y.newHistoryHash();
final TabView tb = Y.newTabView(TabViewConfig.create(new TabConfig[]{
TabConfig.create().label("tab1").content("<p>11111111111 foo content</p>"),
TabConfig.create().label("tab2").content("<p>2222222222222222<b>Hello</b>foo <i>content</i></p>"),
TabConfig.create().label("tab3").content("<p>3333333333333<b>ben parker</b>foo <i>holla dooba do</i></p>"),
}));
tb.render(parent);
tb.after("selectionChange", new EventCallback<TabViewEvent>() {
@Override
public void call(TabViewEvent e) {
/* note e.newVal is the selected child widget - we cast directly.
* @see http://yuilibrary.com/yui/docs/api/classes/WidgetParent.html#attr_selection
*/
Widget selChild = e.newValObj().cast();
int newTabIndex = selChild.getInt("index");
console.log("tabview selectionChange: "+newTabIndex);
history.addValue("tab", newTabIndex==0 ? null : newTabIndex+"");
}
});
tb.selectChild(parseInt(history.get("tab"), 0));
Y.on("history:change", new EventCallback<HistoryEvent>() {
@Override
public void call(HistoryEvent e) {
// Ignore changes we make ourselves, since we don't need
// to update the selection state for those. We're only