Sep 13, 2011, 2:04 PM
[CLOSED] Reading controls int tabpanels issue
There is a tabpanel in my application with two panels. Each have a radiobuttonlist into them.
On PageLoad i set checked radiobutton for both of them. The problem is that in control directclick event, radios in the second tabpanel are always unchecked, unless i click in the second tab.
To reproduce, execute the example below. Put a breakpoint in bt1_DirectClick and press the button as soon as the screen is loaded, without selecting the second tab. Notice that only pA1 is checked, when both pA1 and pB1 should be.
Now, refresh the page and select the second tab before pressing the button. Notice that both radios will have their correct values (true).
On PageLoad i set checked radiobutton for both of them. The problem is that in control directclick event, radios in the second tabpanel are always unchecked, unless i click in the second tab.
To reproduce, execute the example below. Put a breakpoint in bt1_DirectClick and press the button as soon as the screen is loaded, without selecting the second tab. Notice that only pA1 is checked, when both pA1 and pB1 should be.
Now, refresh the page and select the second tab before pressing the button. Notice that both radios will have their correct values (true).
<%@ Page Language="C#" AutoEventWireup="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!Page.IsPostBack)
{
pB1.Checked = true;
pA1.Checked = true;
}
bt1.DirectClick += new ComponentDirectEvent.DirectEventHandler(bt1_DirectClick);
}
void bt1_DirectClick(object sender, DirectEventArgs e)
{
bool aba1 = pA1.Checked;
bool aba2 = pB1.Checked;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager runat="server">
</ext:ResourceManager>
<ext:TabPanel runat="server">
<Items>
<ext:Panel Title="Panel A" runat="server" ID="panelA">
<Items>
<ext:RadioGroup ID="RgGrupos" runat="server">
<Items>
<ext:RadioColumn ID="RgColumnAgrupamento" runat="server">
<Items>
<ext:Radio ID="pA1" runat="server" BoxLabel="A">
</ext:Radio>
<ext:Radio ID="pA2" runat="server" BoxLabel="B">
</ext:Radio>
</Items>
</ext:RadioColumn>
</Items>
</ext:RadioGroup>
</Items>
</ext:Panel>
<ext:Panel Title="Panel B" runat="server" ID="panel1">
<Items>
<ext:RadioGroup ID="RadioGroup1" runat="server">
<Items>
<ext:RadioColumn ID="RadioColumn1" runat="server">
<Items>
<ext:Radio ID="pB1" runat="server" BoxLabel="A">
</ext:Radio>
<ext:Radio ID="pB2" runat="server" BoxLabel="B">
</ext:Radio>
</Items>
</ext:RadioColumn>
</Items>
</ext:RadioGroup>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
<ext:Button runat="server" ID="bt1"></ext:Button>
</div>
</form>
</body>
</html>
Last edited by Daniil; Sep 19, 2011 at 6:18 PM.
Reason: [CLOSED]