[SOLVED] TabPanel.SetActiveTab with PostBack
*NEW - Coolite Toolkit Version 0.6.0 now available for download or view examples.
 

Coolite Forums

Welcome Guest ( Login | Register )
 
[SOLVED] TabPanel.SetActiveTab with PostBack
Subscribe
Last Login: Today @ 4:08:49 AM
Posts: 580,
Posted 7/9/2008 10:43:07 AM

Group: Coolite Premium Member & Early Adopter
Hello,

When using the TabPanel.SetActiveTab with StateProvider PostBack it appears to be reverting back to the first tab.

I have the following:


<ExtJS:TabPanel ID="Tabs" runat="server" ActiveTab="0" AutoHeight="True" AutoWidth="True" AutoPostBack="True">
    <Tabs>
        <ExtJS:Tab ID="Tab1" runat="server" IconCls="TabTenderSearch" Title="Customer 1" AutoHeight="True" AutoWidth="True">
            <Content>
                Word
            </Content>
        </ExtJS:Tab>
        <ExtJS:Tab ID="Tab2" runat="server"
IconCls="TabTenderSearch" Title="Customer 2" AutoHeight="True"
AutoWidth="True">

            <Content>

                Word 2

            </Content>

        </ExtJS:Tab>

    </Tabs>
</ExtJS:TabPanel>


Code behind is:


Tabs.SetActiveTab(Tab2);


Cheers,
Timothy


----
Timothy Grant Vogelsang
tvogelsang [at] gmail [dot] com
Coolite Toolkit 0.7 SVN (Professional Edition)
Microsoft .NET Framework 2.0
Microsoft ASP.NET Ajax 1.0

Last Login: Today @ 2:12:17 PM
Posts: 387,
Posted 7/9/2008 12:35:07 PM

Group: Core Development Team
 Hi Timothy,

I can't reproduce such behaviour with your posted code.  Can you confirm that below example is not working for you:


<head runat="server">
    <title>Untitled Page</title>
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
       
        protected void TabsChanged(object sender, EventArgs e)
        {
            Tabs.SetActiveTab(Tab2);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" StateProvider="PostBack" />
    <ext:TabPanel ID="Tabs" runat="server" ActiveTab="0" AutoHeight="True" AutoWidth="True"
        AutoPostBack="True" OnTabChanged="TabsChanged">
        <Tabs>
            <ext:Tab ID="Tab1" runat="server" IconCls="TabTenderSearch" Title="Customer 1" AutoHeight="True"
                AutoWidth="True">
                <Content>
                    Word
                </Content>
            </ext:Tab>
            <ext:Tab ID="Tab2" runat="server" IconCls="TabTenderSearch" Title="Customer 2" AutoHeight="True"
                AutoWidth="True">
                <Content>
                    Word 2
                </Content>
            </ext:Tab>
        </Tabs>
    </ext:TabPanel>
    </form>
</body>


The right behaivour of this example: after postback always selected second tab

Can you post full code of your example? Where are you calling the SetActiveTab (in PageInit, PageLoad, any event handler or in PreRender). Please provide me by these information and I'll try to help you.

Vladimir
Vladimir Shcheglov,
Coolite Inc.
Core Developer
Last Login: Today @ 4:08:49 AM
Posts: 580,
Posted 7/9/2008 1:09:48 PM

Group: Coolite Premium Member & Early Adopter
Hello Vladimir,

I'll get an example ready for you tonight!

Cheers,
Timothy


----
Timothy Grant Vogelsang
tvogelsang [at] gmail [dot] com
Coolite Toolkit 0.7 SVN (Professional Edition)
Microsoft .NET Framework 2.0
Microsoft ASP.NET Ajax 1.0

Last Login: Today @ 4:08:49 AM
Posts: 580,
Posted 7/13/2008 11:06:37 AM

Group: Coolite Premium Member & Early Adopter
Got the example:


    <form runat="server">
        <script runat="server">
            protected void btnTest_Click(object s, EventArgs e)
            {
                Tabs.SetActiveTab(TabTwo);
            }
            protected void btnTest2_Click(object s, EventArgs e)
            {
               
            }   
        </script>
        <asp:ScriptManager runat="server" EnablePartialRendering="True" />
        <ExtJS:ScriptManager runat="server" StateProvider="PostBack" Theme="Gray" />
        <asp:UpdatePanel runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <ExtJS:TabPanel ID="Tabs" runat="server" ActiveTab="0" AutoHeight="True" AutoPostBack="True">
                    <Tabs>
                        <ExtJS:Tab ID="TabOne" runat="server" AutoHeight="True" Title="Tab 1">
                            <Content>
                                <ExtJS:Button ID="btnTest" runat="server" onclick="btnTest_Click" Text="Test" />
                            </Content>
                        </ExtJS:Tab>
                        <ExtJS:Tab ID="TabTwo" runat="server" AutoHeight="True" Title="Tab 2">
                            <Content>
                                <ExtJS:Button ID="btnTest2" runat="server" onclick="btnTest2_Click" Text="Test 2" />
                            </Content>
                        </ExtJS:Tab>
                    </Tabs>
                </ExtJS:TabPanel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>


Click Test in the first Tab it will switch you to Tab 2.  Now click Test 2 in the 2nd tab and it takes you back to Tab 1

Cheers,
Timothy


----
Timothy Grant Vogelsang
tvogelsang [at] gmail [dot] com
Coolite Toolkit 0.7 SVN (Professional Edition)
Microsoft .NET Framework 2.0
Microsoft ASP.NET Ajax 1.0

Last Login: Today @ 2:12:17 PM
Posts: 387,
Posted 7/13/2008 11:48:49 AM

Group: Core Development Team
Hi Timothy,

Thank you for your code. This helped us find a bug. The fix will
be available in svn tomorrow (Monday). Now (before the emergence of fix), I recommend to use the following code:


   // old code
   //Tabs.SetActiveTab(TabTwo);
  
   //The code, which works
   Tabs.ActiveTab = 1;


I will inform you when the fix will be ready.

Thanks again

Vladimir
Vladimir Shcheglov,
Coolite Inc.
Core Developer
Last Login: Today @ 4:08:49 AM
Posts: 580,
Posted 7/13/2008 12:28:11 PM

Group: Coolite Premium Member & Early Adopter
Thanks!  Your solution is what I've already been using, sorry I should have mentioned that in my response

Will this bump to 0.5.5 or will I need to recompile with SVN?

Cheers,
Timothy


----
Timothy Grant Vogelsang
tvogelsang [at] gmail [dot] com
Coolite Toolkit 0.7 SVN (Professional Edition)
Microsoft .NET Framework 2.0
Microsoft ASP.NET Ajax 1.0

Last Login: Today @ 2:48:09 PM
Posts: 1,172,
Posted 7/14/2008 2:29:07 AM

Group: Core Development Team
Hi Timothy,

Thanks for reporting the TabPanel bug. It has been fixed.

At the moment the fix is only available from SVN.

Are you building from SVN or using the public releases? We're more than happy to send you a custom build of either v0.5.4 or the current /trunk/.

Of course, if you're building from SVN, just perform an update and everything should work as expected.

Hope this helps.
--
Geoffrey McGill
Coolite Inc.
Core Developer
twitter [personal] [coolite]
Last Login: Today @ 4:08:49 AM
Posts: 580,
Posted 7/14/2008 8:38:30 AM

Group: Coolite Premium Member & Early Adopter
Thanks I used the SVN checkout this morning and it worked!

Cheers,
Timothy


----
Timothy Grant Vogelsang
tvogelsang [at] gmail [dot] com
Coolite Toolkit 0.7 SVN (Professional Edition)
Microsoft .NET Framework 2.0
Microsoft ASP.NET Ajax 1.0

« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -8:00, Time now is 2:48pm