Dec 07, 2010, 10:03 AM
Reading checkbox value from tabpage
Hi,
I'm having following problem for a while now and hope someone can confirm it's a bug, or that i'm the problem ;)
When I use a checkbox on a tabpage, the value is not correctly posted back in a DirectEvent when the tabpage was not made visible/active. This is only with a checkbox, the value of a textfield is correctly available in the DirectEvent.
I'm using version: 1.0.0 RC1
Thanks for any help!
Sander
I'm having following problem for a while now and hope someone can confirm it's a bug, or that i'm the problem ;)
When I use a checkbox on a tabpage, the value is not correctly posted back in a DirectEvent when the tabpage was not made visible/active. This is only with a checkbox, the value of a textfield is correctly available in the DirectEvent.
I'm using version: 1.0.0 RC1
Thanks for any help!
Sander
<%@ Page Language="C#" EnableViewState="true" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Tab1Checkbox.Checked = true;
Tab2Checkbox.Checked = true;
Tab2TextField.Text = "text...";
}
}
public void ButtonClick(object sender, DirectEventArgs e)
{
//When tab 2 was not made visible/active, the value will be false and should be true (as initialized in the Page_load)....
bool b2 = Tab2Checkbox.Checked;
//The visible checkbox will return the value true, which is correct.
bool b1 = Tab1Checkbox.Checked;
//However, this value is the same as initialized in the Page_load....
string s = Tab2TextField.Text;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Checkbox in hidden tab test</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Button ID="SaveButton" runat="server" Text="Save" Icon="Accept">
<DirectEvents>
<Click OnEvent="ButtonClick" />
</DirectEvents>
</ext:Button>
<ext:TabPanel runat="server">
<Items>
<ext:FormPanel ID="InvoiceRowsPanel" runat="server" Title="Tab 1" FormGroup="true"
AutoHeight="true">
<Content>
<ext:Checkbox runat="server" ID="Tab1Checkbox" FieldLabel="Check me" />
</Content>
</ext:FormPanel>
<ext:FormPanel ID="FormPanel1" runat="server" Title="Tab 2" FormGroup="true" AutoHeight="true">
<Items>
<ext:Checkbox runat="server" ID="Tab2Checkbox" FieldLabel="Check me" />
<ext:TextField runat="server" ID="Tab2TextField" FieldLabel="Some text" />
</Items>
</ext:FormPanel>
</Items>
</ext:TabPanel>
</form>
</body>
</html>