PDA

View Full Version : [CLOSED] Panel#findReExpander must be passed a valid collapseDirection



sbg
Sep 26, 2012, 10:23 AM
Hello,

I have a viewport with some panels. For a Panel in the code behind on Page_Load we set the Collapse direction:


panel.CollapseDirection = Direction.Left;

But when I click on the collapse button an exception is thrown, in this point:


throw ("Panel#findReExpander must be passed a valid collapseDirection")

It seems to me that it fails to found the right item in the switch. In the direction variable I see "Left", but in the switch I see:



case c.DIRECTION_TOP:
case c.DIRECTION_BOTTOM:
// more code
case c.DIRECTION_LEFT:
case c.DIRECTION_RIGHT:
// more code


and above DIRECTION_LEFT is 'left', not 'Left'.

I'm using the version 2.0 (last from SVN)

Daniil
Sep 26, 2012, 1:12 PM
Hi @sbg,

I am unable to reproduce with this Panel.

<ext:Panel runat="server" Collapsible="true" CollapseDirection="Left" />

"Left" is rendered as "left".


I'm using the version 2.0 (last from SVN)

The last sources are here:
http://svn.ext.net/premium/branches/2.1/

sbg
Sep 26, 2012, 1:38 PM
The last sources are here:
http://svn.ext.net/premium/branches/2.1/

Are there any breaking changes from 2.0?

thank you

sbg
Sep 26, 2012, 2:38 PM
Hi @sbg,

I am unable to reproduce with this Panel.

<ext:Panel runat="server" Collapsible="true" CollapseDirection="Left" />

"Left" is rendered as "left".



Yes, from markup it is rendered as "left", but if you change it in an ajax event, the eval code pushed to the client is like this:



({
App.PanelvxoDL2AaIkiTm8yexCcLg.collapseDirection=\"Left\";
})

Daniil
Sep 26, 2012, 3:28 PM
Are there any breaking changes from 2.0?

There are mainly bug-fixes and improvements. Generally, there should not be breaking changes. Though I can't guarantee.

Anyway, the SVN log is at your service.


Yes, from markup it is rendered as "left", but if you change it in an ajax event, the eval code pushed to the client is like this:



({
App.PanelvxoDL2AaIkiTm8yexCcLg.collapseDirection=\"Left\";
})


This property should not be changed during AJAX, it is a config option. So, it doesn't make any sense without re-rendering. This should work:


protected void ChangeCollapseDirection(object sender, DirectEventArgs e)
{
this.Panel1.SuspendScripting();
this.Panel1.CollapseDirection = Direction.Right;
this.Panel1.ResumeScripting();
this.Panel1.Render();
}