Hi,
I've cut down the existing code lots - some of the problems disappear - this is the simplest I could get that shows some symptoms.
The example has Nested Tabs - navigating to Tab "333" then pressing the "Save Button" on Sub-Tab "AA" gives cb1=AR and cb2="" - if you then go to Sub-Tab="BB" the combo-box has a value - returning to Sub-Tab "AA" and pressing save gives cb1=AR and cb2=Alaska
I've tried DeferredRender="false"
Any suggestions please ?
thanks
rich.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestTabs1.aspx.cs" Inherits="WebApplication1.TestTabs1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Xml" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
var store1 = this.Store1;
store1.DataSource = new object[]
{
new object[] { "AL", "Alabama", "The Heart of Dixie" },
new object[] { "AK", "Alaska", "The Land of the Midnight Sun" },
new object[] { "AZ", "Arizona", "The Grand Canyon State" },
new object[] { "AR", "Arkansas", "The Natural State" },
new object[] { "CA", "California", "The Golden State" },
new object[] { "CO", "Colorado", "The Mountain State" },
new object[] { "CT", "Connecticut", "The Constitution State" },
};
store1.DataBind();
}
</script>
<script type="text/javascript">
// IE9 - createContextFragment fix
if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment) {
Range.prototype.createContextualFragment = function (html) {
var frag = document.createDocumentFragment(), div = document.createElement("div");
frag.appendChild(div);
div.outerHTML = html;
return frag;
};
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="abbr" />
<ext:RecordField Name="state" />
<ext:RecordField Name="nick" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:TabPanel runat="server" >
<Items>
<ext:Panel Title="11" runat="server" AutoHeight="true">
<Items>
<ext:Label runat="server" Text="hi" />
</Items>
</ext:Panel>
<ext:Panel runat="server" AutoHeight="true" Title="333">
<Items>
<ext:TabPanel runat="server" DeferredRender="false" Title="22">
<DirectEvents>
<AfterLayout OnEvent="Tab1_panel_afterLayout" />
</DirectEvents>
<Items>
<ext:Panel runat="server" Title="AA" AutoHeight="true">
<Items>
<ext:Button ID="SaveBtn" runat="server" Text="Save">
<DirectEvents>
<Click OnEvent="SaveBtn_onClick">
<EventMask ShowMask="true" />
</Click>
</DirectEvents>
</ext:Button>
<ext:ComboBox runat="server" ID="cb1" StoreID="Store1" DisplayField="abbr" ValueField="abbr"
Mode="Local" />
</Items>
</ext:Panel>
<ext:Panel ID="Panel1" runat="server" Title="BB" AutoHeight="true">
<Items>
<ext:ComboBox runat="server" ID="cb2" StoreID="Store1" DisplayField="state" ValueField="state"
Mode="Local" />
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</div>
</form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
namespace WebApplication1
{
public partial class TestTabs1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[DirectMethod]
public void Tab1_panel_afterLayout(object sender, DirectEventArgs e)
{
this.cb1.SetValueAndFireSelect("AR");
this.cb2.SetValueAndFireSelect("Alaska");
}
[DirectMethod]
public void SaveBtn_onClick(object sender, DirectEventArgs e)
{
System.Diagnostics.Debug.WriteLine("cb1=" + this.cb1.SelectedItem.Text);
System.Diagnostics.Debug.WriteLine("cb2=" + this.cb2.SelectedItem.Text);
}
}
}