Stateful accordion

  1. #1

    Stateful accordion

    Lo. Is maintening state accros postback on an accordion supposed to work?
    I set
    StateProvide="Cookie"
    on my ScriptManager and
    stateFul="True"
    on my Accordion, but every time i change page / click a button (I tried with a simple button doing only a postback), but still the first panel is always activated after, instead of the previous one.
    Any idea?
  2. #2

    RE: Stateful accordion

    Hi Rod,

    The accordion maintenances own state between postbacks. For ScriptManager need set StateProvider="Postback" (which is default value)

    Test case which works correctly for me (the selected panel is still activated after postbacks)

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!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>
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager runat="server">
            </ext:ScriptManager>
            
            <ext:Panel runat="server" Title="Accordion" Width="300" Height="400">
                <Body>
                    <ext:Accordion runat="server" >
                        <ext:Panel runat="server" Title="Panel1" Collapsed="true"></ext:Panel>
                        <ext:Panel runat="server" Title="Panel2" Collapsed="true"></ext:Panel>
                        <ext:Panel runat="server" Title="Panel3" Collapsed="true"></ext:Panel>
                        <ext:Panel runat="server" Title="Panel4" Collapsed="true"></ext:Panel>
                        <ext:Panel runat="server" Title="Panel5"></ext:Panel>
                    </ext:Accordion>
                </Body>
            </ext:Panel>
            
            <ext:Button runat="server" Text="Postback" AutoPostBack="true"></ext:Button>
        </form>
    </body>
    </html>

  3. #3

    RE: Stateful accordion

    I originally didn't have Collapsed="true" set on my panels, but that doesn't solve the pb.
    The main difference is that my postbacks come from classic linkbuttons living inside accordions panels.
    I'll do some test with your solution and try to make it fail, ty :)
  4. #4

    RE: Stateful accordion

    I did some test and was able to make it work with a simple button. But then I guess I wasn't clear enough in my first post.
    My accordion is used as a menu and is defined in a master page. Items in accordion panel are linkbutton and redirect user between different pages, all based on the same masterpage.
    While a classic extjs is capable of maintening state across different pages (by using a cookie), coolite accordion seems to fail, even when setting StateProvider="Cookie" in my ScriptManager.
    I guess that coolite accordion natively maintain his state via ViewState, but I'm surprised it can't use cookie? Or am I wrong?

Similar Threads

  1. Stateful TextField problem
    By mrozik in forum 1.x Help
    Replies: 2
    Last Post: Apr 13, 2012, 1:37 PM
  2. Stateful default false
    By Spamme in forum 1.x Help
    Replies: 3
    Last Post: Apr 04, 2012, 7:31 AM
  3. [CLOSED] Making a TreePanel stateful
    By jwillmott in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 30, 2010, 11:28 AM
  4. Replies: 5
    Last Post: Nov 11, 2010, 7:33 PM
  5. mvc do not support stateful?
    By sipo in forum 1.x Help
    Replies: 0
    Last Post: May 23, 2010, 7:23 AM

Posting Permissions