BUG: Accordion with DataBinding when data produces no panes

Last post 01-05-2007 5:41 PM by ddanz. 0 replies.

Sort Posts:

  • Devil [666] BUG: Accordion with DataBinding when data produces no panes

    01-05-2007, 5:41 PM
    • Loading...
    • ddanz
    • Joined on 06-20-2005, 4:24 PM
    • Posts 3

    Binding to an XMLDataSource, where the XPath filter of the datasource is changed dynamically to select different subsets of the data.

    The problem occurs when the filter produces no content nodes, and thus no data-bound Panes are produced for the Accordion Control.

    The behaviour barfs at runtime during initialization with a null reference to this._panes[this._selectedIndex].childNodes. 

    The error is

            if (this._autoSize == AjaxControlToolkit.AutoSize.None) {
                // Adjust the height before we even start
                var selectedHeight = this._getTotalHeight(this._getElement(this._panes[this._selectedIndex].childNodes, 0));
                e.style.height = (this._headerHeight + selectedHeight) + 'px';
                this._skipNextResize = true;
            }
    

    Tested in the debuuger to set selectedHeight=0 and continue --- it works, so I'll probably code such a workaround until you folks fix the bug.

    There is another problem that trips at the same point:   setting the extender SelectedIndex="-1" or any other value that is outside the size of the Panes array (for example, setting it to 2 and then have the filter produce less than 3 panes).   It should be range-checked when used in the behaviour code.

    Even with these bugs fixed, I would find the Accordion Control a lot more useful if it was possible to have NO active pane.   That is, if it could tolerate an initial value of SelectedIndex = -1, and also if clicking the ActivePane collapsed that pane and set the dynamic _selectedIndex = -1. 

     

Page 1 of 1 (1 items)
Microsoft Communities
Page view counter