#18603 closed defect (invalid)
Issue With respect to TabContainer - SelectChild
Reported by: | saravanakumarmay06 | Owned by: | saravanakumarmay06 |
---|---|---|---|
Priority: | undecided | Milestone: | tbd |
Component: | Dijit | Version: | 1.10.4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Team ,
Currently we are migrating our DOJO Framework from 1.7 to 1.10.4 . So far it has been great experience with new Dojo1.10
I’m facing an issue in dojo 1.10.4. Can you help on these.
myPage.html
<div dojoattachpoint= "myDom"> </div> <div dojoattachpoint = "clickMe" dojotype = "dojot.form.button">ClickMe?</div>
myPage.js
dojo.provide("myPage")
dojo.require("myTabContainer"); dojo.require("myContentPane")
dojo.declare("myPage") { tabs : "",
startup: function() {
if (this._started) { return; } this.inherited(arguments);
dojo.connect(this.clickMe , "onClick" , dojo.hitch(this , this._addDynamicTab)); this._createTabContainer(); for(i=0;i<2;i++) {
this._addChild(i);
}
},
_createTabContainer : function() {
this.tabs = new myTabContainer().placeAt(myDom, "first");
},
_addChild:function(i) {
Var contentPane = new myContentPane({title : "myTitle - " + i}); this.tabs.addChild(contentPane); contentPane .set("content", "Some Div"); contentPane.startup(); this.tabs.set("doLayout", false);
},
_addDynamicTab : function() {
this._addChild(3); this.tabs.selectChild(this.tabs.getLastChild());
}
});
myContentPane.js
dojo.provide("myContentPane") dojo.require("dijit.layout.ContentPane?"") dojo.declare("myContentPane", [dijit.layout.ContentPane?], {
startup: function() {
if (this._started) { return; } this.inherited(arguments);
}
});
myTabContainer.js dojo.provide("myTabContainer");
dojo.require("dijit.layout.TabContainer?"); dojo.require("dijit._Contained"); dojo.declare("myTabContainer", [dijit.layout.TabContainer?], {
startup: function () {
if (this._started) { return; } this.inherited(arguments);
},
getLastChild: function () {
var lastChild = this.getChildren().length - 1; return this.getChildren()[lastChild];
},
addChild: function () {
Attachments (1)
Change History (7)
Changed 6 years ago by
Attachment: | tabContainer - Issue.txt added |
---|
comment:1 Changed 6 years ago by
Component: | General → Dijit |
---|---|
Owner: | set to saravanakumarmay06 |
Status: | new → pending |
comment:2 Changed 6 years ago by
Status: | pending → new |
---|
Since i'm using module by module , it will be good if we track this via my approach. pls find he code and descriprion here
myPage.html
<div dojoattachpoint= "myDom"> </div> <div dojoattachpoint = "clickMe" dojotype = "dojox.form.button">ClickMe?</div>
myPage.js
dojo.provide("myPage")
dojo.require("myTabContainer"); dojo.require("myContentPane")
dojo.declare("myPage" , [dijit._TemplatedMixin, dijit._WidgetsInTemplateMixin] , { tabs : "",
startup: function() {
if (this._started) { return; } this.inherited(arguments);
dojo.connect(this.clickMe , "onClick" , dojo.hitch(this , this._addDynamicTab)); this._createTabContainer(); for(i=0;i<2;i++) {
this._addChild(i);
}
},
_createTabContainer : function() {
this.tabs = new myTabContainer().placeAt(myDom, "first");
},
_addChild:function(i) {
Var contentPane = new myContentPane({title : "myTitle - " + i}); this.tabs.addChild(contentPane); contentPane .set("content", "Some Div"); contentPane.startup(); this.tabs.set("doLayout", false);
},
_addDynamicTab : function() {
this._addChild(3); this.tabs.selectChild(this.tabs.getLastChild());
}
});
myContentPane.js
dojo.provide("myContentPane") dojo.require("dijit.layout.ContentPane?"") dojo.declare("myContentPane", [dijit.layout.ContentPane?], {
startup: function() {
if (this._started) { return; } this.inherited(arguments);
}
});
myTabContainer.js dojo.provide("myTabContainer");
dojo.require("dijit.layout.TabContainer?"); dojo.require("dijit._Contained"); dojo.declare("myTabContainer", [dijit.layout.TabContainer?], {
startup: function () {
if (this._started) { return; } this.inherited(arguments);
},
getLastChild: function () {
var lastChild = this.getChildren().length - 1; return this.getChildren()[lastChild];
},
addChild: function () {
this.
comment:3 Changed 6 years ago by
Status: | new → pending |
---|
I'm not going to look at this unless you make a simplified test case, a single HTML file, and attach it using the attach file button.
comment:4 Changed 6 years ago by
Status: | pending → new |
---|
Pls find the simplified code changes.
mypage.htm
<div dojoattachpoint= "myDom"> </div> <div dojoattachpoint = "clickMe" dojotype = "dijit.form.button">ClickMe?</div>
myPage.js
dojo.provide("myPage");
dojo.require("dijit.form.Button"); dojo.require("dijit.layout.TabContainer?"); dojo.require("dijit.layout.TabController?"); dojo.require("dijit._Contained"); dojo.require("dijit.layout.ContentPane?");
dojo.declare("myPage", [dijit.layout.TabContainer?, dijit.layout.ContentPane?], {
tabs : null, Content : null ,
startup: function() { dojo.connect(this.clickMe , "onClick" , this ,"_onButtonClick");
this.tabs = new dijit.layout.TabContainer?({
style: "height: 100%; width: 100%;"
}, "myDom");
var cp1 = new dijit.layout.ContentPane?({
title: "Food", content: "We offer amazing food"
}); this.tabs.addChild(cp1);
var cp2 = new dijit.layout.ContentPane?({
title: "Drinks", content: "We are known for our drinks."
});
this.tabs.addChild(cp2); this.tabs.startup();
},
addChild: function() {
overrides the inherited TabContainer? methods this.inherited(arguments);
},
_onButtonClick : function() {
var cp3 = new dijit.layout.ContentPane?({
title: "Title", content: "New Title"
});
this.tabs.addChild(cp3); this.tabs.selectChild(this.tabs.getLastChild());
},
getLastChild: function() {
var lastChild = this.getChildren().length - 1; return this.getChildren()[lastChild];
}
selectChild: function(child) {
this.inherited(arguments);
}
});
comment:5 Changed 6 years ago by
Status: | new → pending |
---|
I'm not going to look at this unless you make a simplified test case, a single HTML file, and attach it using the attach file button.
comment:6 Changed 6 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
One problem is that you're referencing a widget called "dojot.form.button", yet there is no such widget.
Another problem is that this syntax is just wrong:
If you still have problems after fixing those issues, then come up with a reduced test case, a single HTML file, that demonstrates the problem, and then attach that to the ticket.