[CLOSED] Reading controls int tabpanels issue

  1. #1

    [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).

    <%@ 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]
  2. #2
    By default, TabPanel doesn't render inactive tab until its activation
    You can set for DeferredRender="false" TabPanel to render all tabs immediately
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. [CLOSED] Reading grid in the server
    By Pablo_Azevedo in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 12, 2012, 7:51 PM
  2. Reading checkbox value from tabpage
    By prost in forum 1.x Help
    Replies: 10
    Last Post: May 17, 2011, 7:39 AM
  3. [CLOSED] Problems reading slider value in javascript
    By ewgoforth in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 07, 2011, 10:33 AM
  4. [CLOSED] Reading SelectedRow Column values
    By sadaf in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 09, 2010, 10:51 AM
  5. [CLOSED] Reading data from a store in codebehind
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 16, 2009, 5:11 PM

Posting Permissions