PDA

View Full Version : [CLOSED] Script Error using open a page in Tab Panel



speedstepmem4
Oct 22, 2013, 8:10 AM
Hi,

I have converted our 1.x application to 2.x format what you are mentioned the changes. Please below the sample pages.

The following question/issues,
1. In 1.x version, automatically execute Show directevent when load the tabpanel. In 2.x i will fire the event manually in Page load event (check PortalSub.aspx). How it will fire automatically or is there any other event?

2. I have used to "Show" directevent When i show tab2 page. but it was working fine in 1.x version. Now it shows the following script error. For example,
click Tab5 -> JavaScript runtime error: No URL specified ->JavaScript runtime error: 'loader2' is undefined ->JavaScript runtime error: Could not complete the operation due to error 80020101.

1. Portal.aspx


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ScriptManager1.AddScript("CallPage('1',document.getElementById('href_one'));");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
<ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
Layout="FitLayout">
<Content>
<ext:Container ID="Container1" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="pnlNorth" runat="server" Height="75" Border="false" Header="false"
BodyStyle="background-color: transparent;" Region="North">
<Content>
North section
</Content>
</ext:Panel>
<ext:Panel runat="server" Width="165" ID="pnlSettings" BodyStyle="background-color: #284051;"
Region="West">
<Content>
<ext:Container ID="Container2" runat="server" Layout="AccordionLayout">
<Items>
<ext:Panel ID="Panel1" runat="server" Border="false" Collapsed="True" AutoScroll="true"
BodyStyle="padding:6px;">
<Content>
<div class="link_west">
<ul>
<li id="menu_dash" runat="server"><a href="#" id="href_one" runat="server" onclick="CallPage('1',this);">
<asp:Literal ID="lbl_dash" runat="server" Text="Dashboard"></asp:Literal></a></li>
</ul>
</div>
</Content>
</ext:Panel>
</Items>
</ext:Container>
</Content>
</ext:Panel>
<ext:TabPanel ID="tpPortal" runat="server" Border="false" BodyStyle="background-color: transparent;"
Region="Center">
<Items>
</Items>
</ext:TabPanel>
</Items>
</ext:Container>
</Content>
</ext:Viewport>
</form>
<script type="text/javascript">
var subPortalUrl = "PortalSub.aspx?module={0}";

function CallPage(val, anchorObj) {
ActiveTabValue = val;
var modulename = "";
if (anchorObj != null)
modulename = anchorObj.innerHTML;
if (modulename != "")
DimensionPortal.addTab({ title: modulename, url: Ext.String.format(subPortalUrl, val), id: val });
}

var DimensionPortal = {
hashCode: function (str) {
var hash = 1315423911;

for (var i = 0; i < str.length; i++) {
hash ^= ((hash << 5) + str.charCodeAt(i) + (hash >> 2));
}

return (hash & 0x7FFFFFFF);
},

addTab: function (config) {
if (Ext.isEmpty(config.url, false)) {
return;
}
var tp = Ext.getCmp('tpPortal');
var sid = 'id_' + this.hashCode(config.url);
var tab = tp.getComponent(sid);
if (!tab) {
tab = tp.addTab({
id: sid,
title: config.title,
closable: true,
loader: {
loadMask: {
showMask: true,
msg: "Loading " + config.title
},
url: config.url,
renderer: 'frame',
autoLoad: true
},
listeners: {
beforeShow: {
fn: function (item, trigger, index, tag, e) {

}
}
}
});

} else {
tp.setActiveTab(tab);
Ext.get(tab.tabEl).frame();
}
}
};

</script>
</body>
</html>




2. PortalSub.aspx


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["module"] != null)
H_Txt1.Text = Request.QueryString["module"].ToString();

if (!IsPostBack)
NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
}

protected void GridNavigateProcess(object sender, DirectEventArgs e)
{
NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);

}

protected void NavigateProcess(object sender, DirectEventArgs e)
{
NavigatePage(TabPanel1.ActiveTabIndex, ref Tab2);

}


private void NavigatePage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
TabPanel1.ActiveTabIndex = 2;
CurrentTab.Loader.Url = "ActiveTab.aspx?tabid=2";
CurrentTab.Loader.LoadMask.ShowMask = true;
CurrentTab.Loader.LoadMask.Msg = "Loading";
CurrentTab.LoadContent();
}

private void NavigateGridPage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
string headText = string.Empty;
string preLoad = string.Empty;
switch (H_Txt1.Text)
{

case "1":
if (preLoad != "DashBoard")
{
TabPanel1.AddScript("Ext.getCmp('Tab2').tab.show();");

Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
Tab1.Title = "News";

Tab2.Enabled = true;
Tab2.Title = "Open Workflow";

ScriptManager1.AddScript("top.window.Ext.getCmp('pnlSettings').setDisabled(t rue);");
TabPanel1.ActiveTabIndex = 0;
preLoad = "Dashboard";
}
break;

}
try
{
Tab1.Loader.LoadMask.ShowMask = true;
Tab1.Loader.LoadMask.Msg = "Loading";
Tab1.LoadContent();
}
catch (Exception ex)
{

}
}

</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
<ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
Layout="FitLayout">
<Content>
<ext:Container ID="Container1" runat="server" Layout="BorderLayout">
<Content>
<ext:TabPanel ID="TabPanel1" runat="server" AutoScroll="false" BodyStyle="background-color: #427298;"
TabPosition="top" Region="Center">
<Items>
<ext:Panel ID="Tab1" runat="server">
<Loader ID="loader1" runat="server" Mode="Frame">
</Loader>
<DirectEvents>
<Show OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="120000"
Success="CEvent();">
</Show>
</DirectEvents>
</ext:Panel>
<ext:Panel ID="Tab2" runat="server" BodyStyle="background:white">
<Loader ID="loader2" runat="server" Mode="Frame">
</Loader>
<DirectEvents>
<Show OnEvent="NavigateProcess" ShowWarningOnFailure="false" Timeout="120000">
</Show>
</DirectEvents>
</ext:Panel>
</Items>
</ext:TabPanel>
</Content>
</ext:Container>
</Content>
</ext:Viewport>
<ext:TextField ID="H_Txt1" runat="server" Hidden="true">
</ext:TextField>
<ext:Button ID="Button1" runat="server" AutoPostBack="false" IconCls="ok" Hidden="true">
<DirectEvents>
<Click Delay="1" OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="1200000">
</Click>
</DirectEvents>
</ext:Button>
</form>
</body>
</html>



3. ActiveTab.aspx



<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Page Loaded in Tab " + Request.QueryString["tabid"].ToString());
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
</form>
</body>
</html>

geoffrey.mcgill
Oct 22, 2013, 9:48 AM
Hello,

Please post one question per forum thread. Posting multiple questions in the same thread is VERY difficult to track properly.

As well, please ensure your code samples are reduced to ONLY the minimum required to reproduce the problem. Please remove all code that is not directly related to the problem, such as using five Tabs, when only on one or maybe two are required.

More information regarding post in the forums is available at the following locations:

http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics

http://forums.ext.net/showthread.php?10205-More-Information-Required

speedstepmem4
Oct 22, 2013, 10:07 AM
Hello,

Please post one question per forum thread. Posting multiple questions in the same thread is VERY difficult to track properly.

As well, please ensure your code samples are reduced to ONLY the minimum required to reproduce the problem. Please remove all code that is not directly related to the problem, such as using five Tabs, when only on one or maybe two are required.

More information regarding post in the forums is available at the following locations:

http://forums.ext.net/showthread.php?3440-Forum-Guidelines-For-Posting-New-Topics

http://forums.ext.net/showthread.php?10205-More-Information-Required

Hi Geoffrey,

I have reduced the sample code. I am getting more more errors for convert 1.x to 2.x. So that i was posted a sample which was working fine in old version.

Ok i will post a question for each thread.

Daniil
Oct 22, 2013, 3:35 PM
1. In 1.x version, automatically execute Show directevent when load the tabpanel. In 2.x i will fire the event manually in Page load event (check PortalSub.aspx). How it will fire automatically or is there any other event?


Please try with a Panel's Activate event. It fires each time when a tab is activating.



2. I have used to "Show" directevent When i show tab2 page. but it was working fine in 1.x version. Now it shows the following script error. For example,
click Tab5 -> JavaScript runtime error: No URL specified ->JavaScript runtime error: 'loader2' is undefined ->JavaScript runtime error: Could not complete the operation due to error 80020101.


I think you should configure Loaders with AutoLoad="false".

speedstepmem4
Oct 23, 2013, 4:56 AM
Please try with a Panel's Activate event. It fires each time when a tab is activating.



I think you should configure Loaders with AutoLoad="false".

Hi,

I have changed Activate event instead of Show event. But it comes same error. Like this, JavaScript runtime error: No URL specified ->JavaScript runtime error: 'loader1' is undefined ->JavaScript runtime error: Could not complete the operation due to error 80020101.

Note: Tab loader url will assign in dynamically.
see the method,
NavigateGridPage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab){...} in PortalSub.aspx page.

Please give your suggestion

geoffrey.mcgill
Oct 23, 2013, 5:32 AM
Please give your suggestion

Please post an updated code sample demonstrating exactly how you have things configured. Do not post code that unrelated to the problem.

Daniil
Oct 23, 2013, 5:33 AM
Did you set up AutoLoad="false" for Loaders?

speedstepmem4
Oct 23, 2013, 5:40 AM
Did you set up AutoLoad="false" for Loaders?

Yes, It shows same error



<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["module"] != null)
H_Txt1.Text = Request.QueryString["module"].ToString();
if (!IsPostBack)
NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
}

protected void GridNavigateProcess(object sender, DirectEventArgs e)
{
NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
ScriptManager1.AddScript("top.EnableTabs();");
}

protected void NavigateProcess(object sender, DirectEventArgs e)
{
NavigatePage(TabPanel1.ActiveTabIndex, ref Tab2);

ScriptManager1.AddScript("top.EnableTabs();");

}


private void NavigatePage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
TabPanel1.ActiveTabIndex = 2;
CurrentTab.Loader.Url = "ActiveTab.aspx?tabid=2";
CurrentTab.Loader.LoadMask.ShowMask = true;
CurrentTab.Loader.LoadMask.Msg = "Loading";
CurrentTab.LoadContent();
}

private void NavigateGridPage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
string headText = string.Empty;
string preLoad = string.Empty;
switch (H_Txt1.Text)
{

case "1":
if (preLoad != "DashBoard")
{
TabPanel1.AddScript("Ext.getCmp('Tab2').tab.show();");

Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
Tab1.Title = "News";

Tab2.Enabled = true;
Tab2.Title = "Open Workflow";


ScriptManager1.AddScript("top.window.Ext.getCmp('pnlSettings').setDisabled(t rue);");
ScriptManager1.AddScript("Ext.getCmp('" + Tab2.ClientID + "').enable();");
TabPanel1.ActiveTabIndex = 0;
preLoad = "Dashboard";
}
break;

}
try
{
Tab1.Loader.LoadMask.ShowMask = true;
Tab1.Loader.LoadMask.Msg = "Loading";
Tab1.LoadContent();
}
catch (Exception ex)
{

}
}

</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
<ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
Layout="FitLayout">
<Content>
<ext:Container ID="Container1" runat="server" Layout="BorderLayout">
<Content>
<ext:TabPanel ID="TabPanel1" runat="server" AutoScroll="false" BodyStyle="background-color: #427298;"
TabPosition="top" Region="Center">
<Items>
<ext:Panel ID="Tab1" runat="server">
<Loader ID="loader1" runat="server" Mode="Frame" AutoLoad="false">
</Loader>
<DirectEvents>
<Activate OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="120000"
Success="CEvent();">
</Activate>
</DirectEvents>
</ext:Panel>
<ext:Panel ID="Tab2" runat="server" BodyStyle="background:white">
<Loader ID="loader2" runat="server" Mode="Frame" AutoLoad="false">
</Loader>
<DirectEvents>
<Activate OnEvent="NavigateProcess" ShowWarningOnFailure="false" Timeout="120000">
</Activate>
</DirectEvents>
</ext:Panel>
</Items>
</ext:TabPanel>
</Content>
</ext:Container>
</Content>
</ext:Viewport>
<ext:TextField ID="H_Txt1" runat="server" Hidden="true">
</ext:TextField>
<ext:Button ID="Button1" runat="server" AutoPostBack="false" IconCls="ok" Hidden="true">
<DirectEvents>
<Click Delay="1" OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="1200000">
</Click>
</DirectEvents>
</ext:Button>
</form>
<script type="text/javascript">


function CEvent() {

if (document.getElementById('Tab1_IFrame') != null) {
if (document.getElementById('Tab1_IFrame').contentWin dow != null) {
if (document.getElementById('Tab1_IFrame').contentWin dow.Button1 != null)
document.getElementById('Tab1_IFrame').contentWind ow.Button1.fireEvent("click");
}

}
}

</script>
</body>
</html>

Daniil
Oct 23, 2013, 6:05 AM
The NavigateGridPage method. This is called:

Tab1.LoadContent();
when no Url is specified for the Tab1's Loader.

geoffrey.mcgill
Oct 23, 2013, 6:10 AM
All of your document.getElementById call should be replaced.


document.getElementById('Tab1_IFrame').contentWind ow.Button1

You should be able to simplify to the following, which is also much more robust:


Tab1.getBody().Button1

speedstepmem4
Oct 23, 2013, 6:13 AM
The NavigateGridPage method. This is called:

Tab1.LoadContent();
when no Url is specified for the Tab1's Loader.

Hi,

I have specified the url and also used Tab1.LoadContent().


Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";

try
{
Tab1.Loader.LoadMask.ShowMask = true;
Tab1.Loader.LoadMask.Msg = "Loading";
Tab1.LoadContent();
}
catch (Exception ex)
{

}

Daniil
Oct 23, 2013, 6:26 AM
This is not executed for me when I debug your test case.

Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";

Is it executed for you?

speedstepmem4
Oct 23, 2013, 7:06 AM
This is not executed for me when I debug your test case.

Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";

Is it executed for you?

Hi,

I think you were executed Portalsub.aspx page only. This page is child page of Portal.aspx. Please see the sample already i provided.

Daniil
Oct 23, 2013, 11:15 AM
I think you were executed Portalsub.aspx page only. This page is child page of Portal.aspx. Please see the sample already i provided.

Seems I don't understand. Please elaborate.

speedstepmem4
Oct 23, 2013, 11:46 AM
Seems I don't understand. Please elaborate.

In our application, I have a page(Portal.aspx). This sample source i have provided for the following section http://forums.ext.net/showthread.php?26932-Script-Error-using-open-a-page-in-Tab-Panel&p=119535&viewfull=1#post119535.

This page (Portal.aspx) contains one page (PortalSub.aspx).This sample source i have provided for following section http://forums.ext.net/showthread.php?26932-Script-Error-using-open-a-page-in-Tab-Panel&p=119636&viewfull=1#post119636.

ActiveTab.aspx is the child page which is loaded when click on the tab. This is the actual process we are used.

Actually our start up page is "Portal.aspx"

Daniil
Oct 23, 2013, 12:59 PM
Ok, please post all the required things to reproduce the issue in the single post. Please simplify the code as much as you can.

speedstepmem4
Oct 24, 2013, 5:41 AM
Ok, please post all the required things to reproduce the issue in the single post. Please simplify the code as much as you can.

Please create page names what i specified.

1. Portal.aspx


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ScriptManager1.AddScript("CallPage('1',document.getElementById('href_one'));");
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
<ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
Layout="FitLayout">
<Content>
<ext:Container ID="Container1" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="pnlNorth" runat="server" Height="75" Border="false" Header="false"
BodyStyle="background-color: transparent;" Region="North">
<Content>
North section
</Content>
</ext:Panel>
<ext:Panel runat="server" Width="165" ID="pnlSettings" BodyStyle="background-color: #284051;"
Region="West">
<Content>
<ext:Container ID="Container2" runat="server" Layout="AccordionLayout">
<Items>
<ext:Panel ID="Panel1" runat="server" Border="false" Collapsed="True" AutoScroll="true"
BodyStyle="padding:6px;">
<Content>
<div class="link_west">
<ul>
<li id="menu_dash" runat="server"><a href="#" id="href_one" runat="server" onclick="CallPage('1',this);">
<asp:Literal ID="lbl_dash" runat="server" Text="Dashboard"></asp:Literal></a></li>
</ul>
</div>
</Content>
</ext:Panel>
</Items>
</ext:Container>
</Content>
</ext:Panel>
<ext:TabPanel ID="tpPortal" runat="server" Border="false" BodyStyle="background-color: transparent;"
Region="Center">
<Items>
</Items>
<Listeners>
<BeforeTabClose Fn="BeforeCloseTab" />
</Listeners>
</ext:TabPanel>
</Items>
</ext:Container>
</Content>
</ext:Viewport>
</form>
<script type="text/javascript">
var subPortalUrl = "PortalSub.aspx?module={0}";

function BeforeCloseTab(t) {
var tp = Ext.getCmp('tpPortal');
if (tp.items.length == 1)
return false;
else {
return true;
}
}

function CallPage(val, anchorObj) {
ActiveTabValue = val;
var modulename = "";
if (anchorObj != null)
modulename = anchorObj.innerHTML;
if (modulename != "")
DimensionPortal.addTab({ title: modulename, url: Ext.String.format(subPortalUrl, val), id: val });
}

var DimensionPortal = {
hashCode: function (str) {
var hash = 1315423911;

for (var i = 0; i < str.length; i++) {
hash ^= ((hash << 5) + str.charCodeAt(i) + (hash >> 2));
}

return (hash & 0x7FFFFFFF);
},

addTab: function (config) {
if (Ext.isEmpty(config.url, false)) {
return;
}
var tp = Ext.getCmp('tpPortal');
var sid = 'id_' + this.hashCode(config.url);
var tab = tp.getComponent(sid);
if (!tab) {
tab = tp.addTab({
id: sid,
title: config.title,
closable: true,
loader: {
loadMask: {
showMask: true,
msg: "Loading " + config.title
},
url: config.url,
renderer: 'frame',
autoLoad: true
},
listeners: {
beforeShow: {
fn: function (item, trigger, index, tag, e) {

}
}
}
});

} else {
tp.setActiveTab(tab);
Ext.get(tab.tabEl).frame();
}
}
};


var isTabDisabled = false;
function EnableTabs() {

if (isTabDisabled) {
var tOutEnableTabs = setTimeout(function () {

var tab1 = GetActiveTabExtObj('Tab1');
var tab2 = GetActiveTabExtObj('Tab2');
var tab3 = GetActiveTabExtObj('Tab3');
var tab4 = GetActiveTabExtObj('Tab4');
var tab5 = GetActiveTabExtObj('Tab5');

tab1.setDisabled(false);
tab2.setDisabled(false);
tab3.setDisabled(false);
tab4.setDisabled(false);
tab5.setDisabled(false);
isTabDisabled = false;
clearTimeout(tOutEnableTabs);
}, 300);
}
}
</script>
</body>
</html>


2. PortalSub.aspx


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["module"] != null)
H_Txt1.Text = Request.QueryString["module"].ToString();
if (!IsPostBack)
NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
}

protected void GridNavigateProcess(object sender, DirectEventArgs e)
{
NavigateGridPage(TabPanel1.ActiveTabIndex, ref Tab1);
ScriptManager1.AddScript("top.EnableTabs();");
}

protected void NavigateProcess(object sender, DirectEventArgs e)
{
NavigatePage(TabPanel1.ActiveTabIndex, ref Tab2);

ScriptManager1.AddScript("top.EnableTabs();");

}


private void NavigatePage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
TabPanel1.ActiveTabIndex = 2;
CurrentTab.Loader.Url = "ActiveTab.aspx?tabid=2";
CurrentTab.Loader.LoadMask.ShowMask = true;
CurrentTab.Loader.LoadMask.Msg = "Loading";
CurrentTab.LoadContent();
}

private void NavigateGridPage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
string headText = string.Empty;
string preLoad = string.Empty;
switch (H_Txt1.Text)
{

case "1":
if (preLoad != "DashBoard")
{
TabPanel1.AddScript("Ext.getCmp('Tab2').tab.show();");

Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
Tab1.Title = "News";

Tab2.Enabled = true;
Tab2.Title = "Open Workflow";


ScriptManager1.AddScript("top.window.Ext.getCmp('pnlSettings').setDisabled(t rue);");
ScriptManager1.AddScript("Ext.getCmp('" + Tab2.ClientID + "').enable();");
TabPanel1.ActiveTabIndex = 0;
preLoad = "Dashboard";
}
break;

}
try
{
Tab1.Loader.LoadMask.ShowMask = true;
Tab1.Loader.LoadMask.Msg = "Loading";
Tab1.LoadContent();
}
catch (Exception ex)
{

}
}

</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
<ext:Viewport ID="ViewPort1" runat="server" StyleSpec="background-color: transparent;"
Layout="FitLayout">
<Content>
<ext:Container ID="Container1" runat="server" Layout="BorderLayout">
<Content>
<ext:TabPanel ID="TabPanel1" runat="server" AutoScroll="false" BodyStyle="background-color: #427298;"
TabPosition="top" Region="Center">
<Items>
<ext:Panel ID="Tab1" runat="server">
<Loader ID="loader1" runat="server" Mode="Frame" AutoLoad="false">
</Loader>
<DirectEvents>
<Activate OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="120000"
Success="CEvent();">
</Activate>
</DirectEvents>
</ext:Panel>
<ext:Panel ID="Tab2" runat="server" BodyStyle="background:white">
<Loader ID="loader2" runat="server" Mode="Frame" AutoLoad="false">
</Loader>
<DirectEvents>
<Activate OnEvent="NavigateProcess" ShowWarningOnFailure="false" Timeout="120000">
</Activate>
</DirectEvents>
</ext:Panel>
</Items>
</ext:TabPanel>
</Content>
</ext:Container>
</Content>
</ext:Viewport>
<ext:TextField ID="H_Txt1" runat="server" Hidden="true">
</ext:TextField>
<ext:Button ID="Button1" runat="server" AutoPostBack="false" IconCls="ok" Hidden="true">
<DirectEvents>
<Click Delay="1" OnEvent="GridNavigateProcess" ShowWarningOnFailure="false" Timeout="1200000">
</Click>
</DirectEvents>
</ext:Button>
</form>
<script type="text/javascript">


function CEvent() {

if (document.getElementById('Tab1_IFrame') != null) {
if (document.getElementById('Tab1_IFrame').contentWin dow != null) {
if (document.getElementById('Tab1_IFrame').contentWin dow.Button1 != null)
document.getElementById('Tab1_IFrame').contentWind ow.Button1.fireEvent("click");
}

}
}

</script>
</body>
</html>




3.ActiveTab.aspx


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Page Loaded in Tab " + Request.QueryString["tabid"].ToString());
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ScriptManager1" runat="server" StateProvider="None" Namespace="">
</ext:ResourceManager>
</form>
</body>
</html>

Daniil
Oct 24, 2013, 6:59 AM
Please try the following:

Tab1.Loader.SuspendScripting();
Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
Tab1.Loader.ResumeScripting();

speedstepmem4
Oct 24, 2013, 7:47 AM
Please try the following:

Tab1.Loader.SuspendScripting();
Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
Tab1.Loader.ResumeScripting();

I changed the following in PortalSub.aspx page, still same issues occured like this SCRIPT5009: 'loader1' is undefined ->SCRIPT257: Could not complete the operation due to error 80020101.
->

Daniil, did you check for this changes in your testing area?



case "1":
if (preLoad != "DashBoard")
{
TabPanel1.AddScript("Ext.getCmp('Tab2').tab.show();");
Tab1.SuspendScripting();
Tab1.Loader.Url = "ActiveTab.aspx?tabid=1";
Tab1.ResumeScripting();
Tab1.Title = "News";

Tab2.Enabled = true;
Tab2.Title = "Open Workflow";


ScriptManager1.AddScript("top.window.Ext.getCmp('pnlSettings').setDisabled(t rue);");
ScriptManager1.AddScript("Ext.getCmp('" + Tab2.ClientID + "').enable();");
TabPanel1.ActiveTabIndex = 0;
preLoad = "Dashboard";
}
break;




private void NavigatePage(int CurrentTabIndex, ref Ext.Net.Panel CurrentTab)
{
TabPanel1.ActiveTabIndex = 2;
CurrentTab.SuspendScripting();
CurrentTab.Loader.Url = "ActiveTab.aspx?tabid=2";
CurrentTab.ResumeScripting();
CurrentTab.Loader.LoadMask.ShowMask = true;
CurrentTab.Loader.LoadMask.Msg = "Loading";
CurrentTab.LoadContent();
}

Daniil
Oct 24, 2013, 8:22 AM
This

Tab1.SuspendScripting();
doesn't match

Tab1.Loader.SuspendScripting();

speedstepmem4
Oct 24, 2013, 10:59 AM
This

Tab1.SuspendScripting();
doesn't match

Tab1.Loader.SuspendScripting();

Hi Daniil,

Now i tried my sample it is working fine. I will try to update my actual code and let see.

is this required for using to assign loader url or this should be used our source only?

Daniil
Oct 24, 2013, 1:38 PM
is this required for using to assign loader url or this should be used our source only?

Currently, we are investigating this issue. It looks a bug. We will post here if any new info becomes available.

Daniil
Oct 25, 2013, 2:49 PM
It has been fixed in the SVN trunk. Now a SuspendScripting call should not be required before

.Loader.Url = "url";