Dec 11, 2013, 12:08 AM
Cannot Open a New Tab on the TabPanel with Error Code 200
Hi,
I am currently getting an error code 200 whenever I try to open a report on a new tab. The tab does not open. I am using a side panel for the reports and a tabPanel for the new tabs I have tried catching the error, but it still shows up. Please refer to the code below:
Site (this is where the tabPanel and the reports are defined)
Thanks in advance!
I am currently getting an error code 200 whenever I try to open a report on a new tab. The tab does not open. I am using a side panel for the reports and a tabPanel for the new tabs I have tried catching the error, but it still shows up. Please refer to the code below:
Site (this is where the tabPanel and the reports are defined)
<ext:Panel ID="pnlWest" Region="West" Collapsible="true" CollapseMode="Default" Margins="0 0 7 7" runat="server" Title="Start" Width="225" Frame="false">
<Content>
<uc5:WestMenu ID="ucWestMenu" runat="server"/> //this is how I call the report
</Content>
</ext:Panel>
<ext:TabPanel Region="Center" Margins="0 7 7 0" ID="tpMain" runat="server" ActiveTabIndex="0" EnableTabScroll="true" Frame="true">
<Items>
<ext:Panel ID="Tab1" Title="Home" Icon="House" Closable="false" runat="server" Border="false" Layout="Fit">
</Items>
</ext:TabPanel>
WestMenu (how reports are created)private Ext.Net.NodeCollection GetReports(Ext.Net.NodeCollection treeCollection)
{
if (treeCollection == null)
{
treeCollection = new Ext.Net.NodeCollection();
}
// Create the root
Ext.Net.Node root = new Ext.Net.Node();
root.NodeID = "root";
treeCollection.Add(root);
// Folder Node: Tasks
Ext.Net.Node tnTasks = new Ext.Net.Node();
tnTasks.Text = "Tasks";
tnTasks.Icon = Icon.FolderEdit;
if (this.ViewData["AccountNumber"].ToString().Contains("1"))
{
Ext.Net.Node tnBreak1 = new Ext.Net.Node();
tnBreak1.Text = "Manage Break";
tnBreak1.Icon = Icon.ClockRed;
Ext.Net.ConfigItem ciSite1 = new ConfigItem();
ciSite1.Name = "url";
ciSite1.Value = "https://custom.url.com/1/managebreak/";
ciSite1.Mode = ParameterMode.Value;
tnBreak1.CustomAttributes.Add(ciSite1);
tnTasks.Children.Add(tnBreak1);
}
// Item Node: Sample Break Management Form
Ext.Net.Node tnDoc3 = new Ext.Net.Node();
tnDoc3.Text = "Sample Break Management Form";
tnDoc3.Icon = Icon.PageWhiteAcrobat;
Ext.Net.ConfigItem ciDoc3Site = new ConfigItem();
ciDoc3Site.Name = "url";
ciDoc3Site.Value = "/resources/docs/BreakManagement.pdf";
ciDoc3Site.Mode = ParameterMode.Value;
tnDoc3.CustomAttributes.Add(ciDoc3Site);
tnComplianceLib.Children.Add(tnDoc3);
root.Children.Add(tnTasks);
root.Children.Add(tnComplianceLib);
return treeCollection;
}
//This is how I call the JS function for adding a new tab
<script type="text/javascript" src="/Scripts/name.js"></script>
//this is the handler for when the reports are clicked
tree.Listeners.ItemClick.Handler = "name.addTab({ tabPanel: #{tpMain}, id: node.attributes.id, title: node.attributes.text, icon: node.attributes.iconCls, url: node.attributes.url, rsurl: node.attributes.rsurl });";
//this is the JS function for adding a new tabExt.ns("name");
name = {
addTab: function (config) {
var tabPanel = Ext.getCmp('tpMain');
var tab = tabPanel.getComponent(config.id);
if (Ext.isEmpty(config.url, false)) {
return;
}
if (!tab) {
tab = tabPanel.add({
id: config.id,
title: config.title,
iconCls: config.icon || 'icon-applicationdouble',
closable: true,
layout: 'fit',
autoLoad: {
showMask: true,
url: config.url,
iconCls: config.icon || 'icon-applicationdouble',
mode: 'iframe',
noCache: true,
maskMsg: "Loading '" + config.title + "'...",
scripts: true,
passParentSize: config.passParentSize,
params: { rsurl: config.rsurl }
}
});
tabPanel.setActiveTab(tab);
} else {
tabPanel.setActiveTab(tab);
Ext.get(tab.tabEl).frame();
}
}
};
Additional Information: I have recently updated the ext version to the new one. As a result, I had to change some components to make it work. For instance, I changed Ext.Net.TreeNodeCollection into Ext.Net.NodeCollection and those using Node with Children (all there are from the ext.net breaking changes document).Thanks in advance!