TabPanel and Tabs: How to remember on post back?

  1. #1

    TabPanel and Tabs: How to remember on post back?

    Working with a TabPanel with 2 Tabs attached, the 2nd Tab has a LinkButton inside, when an event fires a post back it resets the Tab selection to the 1st.

    What am I missing here?

    <ExtJS:TabPanel ID="TabPanel" runat="server" ActiveTab="0">
        <Tabs>
            <ExtJS:Tab ID="Tab1" runat="server" Title="Tab 1">
                <Content>
                    Hello World
                </Content>
            </EstJS:Tab>
            <ExtJS:Tab ID="Tab2" runat="server" Title="Tab 2">
    
                <Content>
                    <asp:LinkButton ID="Button" runat="server" Text="Sample Button" />
    
                </Content>
    
            </EstJS:Tab>
        </Tabs>
    </ExtJS:TabPanel>
    Thanks,
    Timothy
  2. #2

    RE: TabPanel and Tabs: How to remember on post back?

    Hi Timothy,

    I tried your sample with the latest build and everything appears to postback and remember state properly. I noticed your tag prefix for a couple of your controls is "EstJS" for others its "ExtJS". That might be causing problems, especially since the "EstJS" tags are set on the second tab.

    Here's a full working sample using the default <ext:> tag prefix.

    Example

    <ext:TabPanel ID="TabPanel" runat="server" ActiveTab="0">
        <Tabs>
            <ext:Tab ID="Tab1" runat="server" Title="Tab 1">
                <Content>Hello World</Content>
            </ext:Tab>
            <ext:Tab ID="Tab2" runat="server" Title="Tab 2">
                <Content><asp:LinkButton ID="Button" runat="server" Text="Sample Button" /></Content>
            </ext:Tab>
        </Tabs>
    </ext:TabPanel>
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3

    RE: TabPanel and Tabs: How to remember on post back?

    Appears to happen when you have your ScriptManager StateProvider set to Cookie and not PostBack -- can you tell me what the difference is? ;)

    And yup you caught me on the misspelling, I had to type it in because I didn't want to post my entire solution!

    Additional question: when is the documentation coming out for this? I'm interested in purchasing a license, but would require the documentation for my company to go for it.

    Cheers,
    Timothy
  4. #4

    RE: TabPanel and Tabs: How to remember on post back?

    Would also appear that a LinkButton inside a TabPanel inside a ViewPort is causing a full post back to trigger. Works if you remove the ViewPort, did I miss something?

        <asp:ScriptManager ID="ScriptManager" runat="server" />
        <ExtJS:ScriptManager ID="ScriptManager2" runat="server" StateProvider="PostBack" Theme="Gray" />
        <asp:UpdatePanel ID="Update" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <ExtJS:ViewPort ID="ViewPort" runat="server">
                    <Content>
                        <ExtJS:BorderLayout ID="BorderLayout1" runat="server">
                            <Center Split="True">
                                <ExtJS:TabPanel ID="TabPanel" runat="server" ActiveTab="0">
                                    <Tabs>
                                        <ExtJS:Tab ID="Tab1" runat="server" Title="Tab 1">
                                            <Content>Hello World</Content>
                                        </ExtJS:Tab>
                                        <ExtJS:Tab ID="Tab2" runat="server" Title="Tab 2">
                                            <Content>
                                                <asp:LinkButton ID="Button" runat="server" Text="Sample Button" />
                                            </Content>
                                        </ExtJS:Tab>
                                    </Tabs>
                                </ExtJS:TabPanel>
                            </Center>
                        </ExtJS:BorderLayout>
                    </Content>
                </ExtJS:ViewPort>
            </ContentTemplate>
        </asp:UpdatePanel>
    Appreciate your help ;)

    Timothy
  5. #5

    RE: TabPanel and Tabs: How to remember on post back?

    If the StateProvider is "PostBack", several controls (including TabPanel) will render hidden input fields which postback a bit of info regarding the controls current state. For TabPanel the state info posted back is the ActiveTab status.

    If StateProvider is "Cookie", then a cookie is used to store state information... although at the moment, there is limited state support in cookie, and I don't think the TabPanel ActiveTab participates in cookie state. We're hoping to really improve cookie state storage support in a future release.

    The full ExtJS docs are available online and basically the same documentation, but via intellisense, should be available within the next couple days (v0.5.2). The online browsable docs and .chm compiled docs will be available with also be available in that same release (v0.5.2).

    Hope this helps.


    Geoffrey McGill
    Founder
  6. #6

    RE: TabPanel and Tabs: How to remember on post back?

    Great, thanks for the information!

    Would you be able to respond to the ViewPort question regarding post back triggers?

    Cheers,
    Timothy
  7. #7

    RE: TabPanel and Tabs: How to remember on post back?

    Hi Timothy,

    Thanks for pointing out this issue. I was able to reproduce the full postback. I think this issue is caused because the DOM elements for ViewPort (and this would occur with Window as well) are actually moved with JavaScript when the page loads. I think they are being moved outside the UpdatePanel wrapper. I'll take a look and see if we can figure out a workaround.

    Although... even if this did work (wrapping ViewPort in a single global UpdatePanel) I would really not recommend. It would be prudent to be a little more focused with the use of an UpdatePanel (if it's even used at all).
    Geoffrey McGill
    Founder
  8. #8

    RE: TabPanel and Tabs: How to remember on post back?

    Yup while I agree with the use of the UpdatePanel, I have a weird situation where the result of the Center region updates a tree view in the West region ;)

    Got any suggestions? I'll look into the UpdatePanels a little further to see if I can weed any other possibilities out!

    Cheers,
    Timothy

Similar Threads

  1. [CLOSED] Can't get TabStrip to remember history like TabPanel
    By AABR in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Aug 18, 2011, 3:11 PM
  2. Partial Post Back
    By hardik in forum 1.x Help
    Replies: 2
    Last Post: Apr 13, 2011, 4:46 AM
  3. Store does not retain value after post back
    By pooja in forum 1.x Help
    Replies: 1
    Last Post: Oct 15, 2010, 6:14 PM
  4. [CLOSED] Post back issues
    By Etisbew in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Jun 24, 2009, 9:06 AM
  5. Replies: 0
    Last Post: May 17, 2008, 5:29 PM

Posting Permissions