May 23, 2012, 9:46 PM
[CLOSED] Bug with GroupTabPanel + Checkbox
This is the only way I know to reproduce this problem. You'll notice in my example that I'm setting the checkbox.checked to true on the initial page load.
if you first click on the second tab, you can see that the checkbox is checked, then go back to the first tab and hit the submit button. The label then shows true, which is what you'd expect.
Now, if you refresh the page, then just hit the submit button without going to the second tab, you'll see that the label now says false.
The bottom line is that the state of the checkbox only seems to be reflected correctly if you've visited the tab where it lives. otherwise it just shows false. I haven't seen this problem with other fields (such as text boxes).
if you first click on the second tab, you can see that the checkbox is checked, then go back to the first tab and hit the submit button. The label then shows true, which is what you'd expect.
Now, if you refresh the page, then just hit the submit button without going to the second tab, you'll see that the label now says false.
The bottom line is that the state of the checkbox only seems to be reflected correctly if you've visited the tab where it lives. otherwise it just shows false. I haven't seen this problem with other fields (such as text boxes).
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManagerControl" runat="server" />
<script runat="server">
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not IsPostBack And Not Ext.Net.X.IsAjaxRequest Then
DataBind()
End If
End Sub
Public Overrides Sub DataBind()
TheCheckbox.Checked = True
End Sub
Protected Sub TheButton_Click(sender As Object, e As DirectEventArgs)
TheLabel.Text = String.Format("Checkbox state: {0}", TheCheckbox.Checked)
End Sub
</script>
<ext:GroupTabPanel runat="server" Width="300" Height="200">
<Groups>
<ext:GroupTab runat="server">
<Items>
<ext:Panel runat="server" Title="Tab 1">
<Items>
<ext:Label ID="TheLabel" runat="server" Text="Nothing to see here" />
</Items>
</ext:Panel>
</Items>
</ext:GroupTab>
<ext:GroupTab runat="server">
<Items>
<ext:Panel runat="server" Title="Tab 2">
<Items>
<ext:Checkbox ID="TheCheckbox" runat="server" />
</Items>
</ext:Panel>
</Items>
</ext:GroupTab>
</Groups>
<Buttons>
<ext:Button runat="server" Text="Submit" Icon="Accept">
<DirectEvents>
<Click OnEvent="TheButton_Click" />
</DirectEvents>
</ext:Button>
</Buttons>
</ext:GroupTabPanel>
</form>
</body>
</html>
Last edited by Daniil; May 24, 2012 at 2:49 PM.
Reason: [CLOSED]