Hi all,
I'm creating programmatically an AccordionContainer with several
AccordionPanes.
Each AccordionPane has the following content: a ContentPane with text and a dijit.form.Button.
My problem is that when an AccordionPane is selected and I click on
its button the event onClick is not triggered.
I'm using dojo 1.1.x.
The routine that creates the AccordionContainer is the following:
function handleResult2(response){
var content = response.getElementsByTagName("content");
var feedList = new dijit.layout.BorderContainer({ style: "position: absolute;top: 50px;height: 500px; width:400px"});
var title = new dijit.layout.ContentPane({region: "top", style: "margin-top:10px;text-align:center;font-size:medium;width:400px;heigth:100px"});
title.setContent("<b>SCI Changes</b>");
feedList.addChild(title);
title.startup();
var accordionContainer = new dijit.layout.AccordionContainer({region: "center", style: "margin-left:25px;margin-top:10px;heigth:400px;width:350px;"});
k = 1;
dojo.forEach(content, function(c, index, array){
dojo.forEach(c.childNodes, function(children, index2, array2){
if(children.localName == "property-change" || children.localName == "dependency-change"){
var accordionPane = new dijit.layout.AccordionPane({title: "Change "+ dojo.number.format(k), style: "position: relative; heigth:150px;width:350px;"});
var info = "<b>SCI Type: </b>" + children.getAttribute("sci-type")+ "<b>SCI Address: </b>" + children.getAttribute("sci-address")+"";
var hostname = children.getAttribute("sci-hostName");
if(hostname != null || hostname != "")
info += "<b>SCI Hostname: </b>" + hostname + "";
var port = children.getAttribute("sci-port");
if(port != null || port != "")
info += "<b>SCI Port: </b>" + port + "";
info += "<b>Change Type: </b>"+children.getAttribute("type")+"";
if(children.localName == "property-change") info += "<b>Property Name: </b>"+ children.getAttribute("propertyName")+"";
if(children.localName == "dependency-change") {
info += "<b>Dependency Type: </b>"+ children.getAttribute("dependency-type")+"";
if(children.getAttribute("type") == "AddSCIInDependency")
info += "<b>Added SCI: </b>"+ children.getAttribute("sci-url")+ "";
if(children.getAttribute("type") == "EliminateSCIInDependency")
info += "<b>Removed SCI: </b>"+ children.getAttribute("sci-url")+ "";
}
var paneContent = [];
var cp = new dijit.layout.ContentPane({});
cp.setContent(info);
var button = new dijit.form.Button({label: "View Changes", onClick: showDiff});
button.setValue(children.getAttribute("uri"));
paneContent[0] = cp.domNode;
paneContent[1] = button.domNode;
accordionPane.setContent(paneContent);
accordionContainer.addChild(accordionPane);
accordionPane.startup();
k++;
}
});
});
feedList.addChild(accordionContainer);
accordionContainer.startup();
var item = new tabData(1, response);
restTabs[1] = item;
feedList.layout();
var tabContainer = dijit.byId("tab2");
tabContainer.addChild(feedList);
feedList.startup();
tabContainer.startup();
}
var content = response.getElementsByTagName("content");
var feedList = new dijit.layout.BorderContainer({ style: "position: absolute;top: 50px;height: 500px; width:400px"});
var title = new dijit.layout.ContentPane({region: "top", style: "margin-top:10px;text-align:center;font-size:medium;width:400px;heigth:100px"});
title.setContent("<b>SCI Changes</b>");
feedList.addChild(title);
title.startup();
var accordionContainer = new dijit.layout.AccordionContainer({region: "center", style: "margin-left:25px;margin-top:10px;heigth:400px;width:350px;"});
k = 1;
dojo.forEach(content, function(c, index, array){
dojo.forEach(c.childNodes, function(children, index2, array2){
if(children.localName == "property-change" || children.localName == "dependency-change"){
var accordionPane = new dijit.layout.AccordionPane({title: "Change "+ dojo.number.format(k), style: "position: relative; heigth:150px;width:350px;"});
var info = "<b>SCI Type: </b>" + children.getAttribute("sci-type")+ "<b>SCI Address: </b>" + children.getAttribute("sci-address")+"";
var hostname = children.getAttribute("sci-hostName");
if(hostname != null || hostname != "")
info += "<b>SCI Hostname: </b>" + hostname + "";
var port = children.getAttribute("sci-port");
if(port != null || port != "")
info += "<b>SCI Port: </b>" + port + "";
info += "<b>Change Type: </b>"+children.getAttribute("type")+"";
if(children.localName == "property-change") info += "<b>Property Name: </b>"+ children.getAttribute("propertyName")+"";
if(children.localName == "dependency-change") {
info += "<b>Dependency Type: </b>"+ children.getAttribute("dependency-type")+"";
if(children.getAttribute("type") == "AddSCIInDependency")
info += "<b>Added SCI: </b>"+ children.getAttribute("sci-url")+ "";
if(children.getAttribute("type") == "EliminateSCIInDependency")
info += "<b>Removed SCI: </b>"+ children.getAttribute("sci-url")+ "";
}
var paneContent = [];
var cp = new dijit.layout.ContentPane({});
cp.setContent(info);
var button = new dijit.form.Button({label: "View Changes", onClick: showDiff});
button.setValue(children.getAttribute("uri"));
paneContent[0] = cp.domNode;
paneContent[1] = button.domNode;
accordionPane.setContent(paneContent);
accordionContainer.addChild(accordionPane);
accordionPane.startup();
k++;
}
});
});
feedList.addChild(accordionContainer);
accordionContainer.startup();
var item = new tabData(1, response);
restTabs[1] = item;
feedList.layout();
var tabContainer = dijit.byId("tab2");
tabContainer.addChild(feedList);
feedList.startup();
tabContainer.startup();
}
Any help will be really appreciated!
Thank you.
