James,
There is still a bit of your code that looks unfamiliar. Here is my code from my identify widget for initializing the tab container:
define(['dojo/_base/declare',
'dijit/_WidgetsInTemplateMixin',
'jimu/BaseWidget',
'jimu/dijit/TabContainer',
...
'jimu/utils',
...
function (declare, _WidgetsInTemplateMixin, BaseWidget, TabContainer, ...
utils, ... ) {
return declare([BaseWidget, _WidgetsInTemplateMixin], {
...
postCreate: function () {
...
this._initTabContainer();
...
_initTabContainer: function () {
var tabs = [];
tabs.push({
title: this.nls.identifylabel,
content: this.tabNode1
});
tabs.push({
title: this.nls.resultslabel,
content: this.tabNode2
});
this.selTab = this.nls.identifylabel;
this.tabContainer = new TabContainer({
tabs: tabs,
selected: this.selTab
}, this.tabIdentify);
this.tabContainer.startup();
this.own(on(this.tabContainer,'tabChanged',lang.hitch(this,function(title){
if(title !== this.nls.resultslabel){
this.selTab = title;
}
})));
utils.setVerticalCenter(this.tabContainer.domNode);
},
And Here is the Widget.html:
<div>
<div data-dojo-attach-point="tabIdentify">
<div class="identify-tab-node" data-dojo-attach-point="tabNode1">
<label>${nls.descriptionlabel}</label>
<div style="width:95%;margin-top:10px;" data-dojo-attach-point="LayerDD">
<label data-dojo-attach-point="identifyFromLbl" style="width:25%;margin-top:10px;margin-bottom:10px;margin-right:10px;">${nls.idfrom}</label>
<select style="width:100%;margin-top:10px;margin-bottom:10px;" data-dojo-attach-point="identifyLayer" data-dojo-type="dijit/form/Select"></select>
</div>
<div data-dojo-attach-point="drawBox" data-dojo-type="jimu/dijit/DrawBox" data-dojo-props="types:['point','polyline','polygon'],showClear:false" style="margin-top:5px;"></div>
</div>
<div class="identify-tab-node" data-dojo-attach-point="tabNode2">
<div data-dojo-attach-point="progressbar"></div>
<div class="result-div" data-dojo-attach-point="divResult">
<label data-dojo-attach-point="divResultMessage">${nls.noresultsfoundlabel}</label>
<a style="float:right; margin-right:10px" href="#" data-dojo-attach-point="btnClear">${nls.clear}</a>
</div>
<hr>
<div data-dojo-attach-point="listDiv"></div>
</div>
</div>
<div data-dojo-type="jimu/dijit/LoadingShelter" data-dojo-attach-point="shelter" data-dojo-props="hidden:true"></div>
</div>