DOJO TabContainer とその tabContainer に追加する ContentPanes をプログラムで作成しています。各 contentPanes にはカスタム ウィジェットが含まれています。コードの一部を以下に示します。タブが表示されると、最初のタブの containerNode の高さが 0px になるため、最初のタブには完全に読み込まれたウィジェットがありますが、ブラウザーには表示されません。これは 1.6 では正しく機能していました。dojo 1.6 を 1.9.3 に置き換えたところ、この問題が発生しました。何か案は?
var availableWidgets = {
'Name': {title: 'Name', widget:'test.ui.NameWidget'},
'Stats': {title: 'Stats', widget:'test.ui.StatsWidget'}
};
postCreate: function(){
var tabContainer = new dijit.layout.TabContainer({controllerWidget: "dijit.layout.TabController"}, this.pContainerDiv);
tabContainer.set('class', 'claro');
tabContainer.set('doLayout', false);
tabContainer.set('style', "width: 100%; height: 100%;");
dojo.forEach(this.menuItems, dojo.hitch(this, function(menuItem, index){
var widgetInfo = availableWidgets[menuItem];
if(widgetInfo != null){
var contentPaneId = portletNamespace + pContext.persistentId + menuItem + 'ContentPane';
var contentPane = new dijit.layout.ContentPane({
id: contentPaneId,
title: widgetInfo.title,
selected: currentSelectedItem == menuItem,
closable: false,
style: 'height:100%;padding: 15px;',
onShow: dojo.hitch(this, function(){
//can no longer do this in 1.9
//dojo.require(widgetInfo.widget);
if (widgetInfo.widget == 'test.ui.NameWidget') {
dojo.require("test.ui.NameWidget");
} else if (widgetInfo.widget == 'test.ui.StatsWidget') {
dojo.require("test.ui.StatsWidget");
}
var currentView = this.widgets[widgetInfo.title];
if(!currentView){
currentView = eval('new ' + widgetInfo.widget + '(this.params)');
currentView.placeAt(contentPaneId, 'last');
// startup called by (dijit/_WidgetBase in 1.9.3) by placeAt above
// currentView.startup();
this.widgets[widgetInfo.title] = currentView;
}
})
});
tabContainer.addChild(contentPane);
}
}));
}