PDA

View Full Version : [CLOSED] Panel Listeners: beforeActivate when panel within (or linked with) tabStrip



supera
May 14, 2012, 5:36 PM
Hi

I have a tabstrip in my page. There are two panels linked with (or within of) this tabStrip.

1 - The listener 'beforeactivate' of panel is not triggered.
2 - The listener 'beforeShow' panel set on the tabStrip.activeTabIndex is not triggered when I run my application. If I click another tab and return to the original tab, the event is triggered.

My tests are made with this sample project:



<%@ Page Language="vb" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" 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 runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<form id="form1" runat="server">

<ext:Viewport ID="Viewport2" runat="server" Layout="BorderLayout">
<Items>
<ext:TabStrip ID="TabStrip1" runat="server" Region="North" ActiveTabIndex="1" >
<Items>
<ext:Tab ActionItemID="test1" Text="Test 1" />
<ext:Tab ActionItemID="test2" Text="Test 2" />
</Items>
</ext:TabStrip>

<ext:Panel ID="test1" Title="test1" Html="teste 1">
<Listeners>
<BeforeActivate Handler="alert('test 1 activated');" />
<BeforeShow Handler="alert('test 1 show!');" />
</Listeners>
</ext:Panel>
<ext:Panel ID="test2" Title="test2" Html="teste 2" >
<Listeners>
<BeforeActivate Handler="alert('test 2 activated');" />
<BeforeShow Handler="alert('test 2 show!');" />
</Listeners>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>

Daniil
May 14, 2012, 8:45 PM
Hi,

TabStrip doesn't support BeforeActivate and Activate event of its items.

Regarding to BeforeShow of initially activated tab. Generally, the component BeforeShow and Show are fired when that component is shown using its show method. The initially activated tab is just rendered, no call of show method.

You can:

1. Call a required script according to ActiveTabIndex property.

2. Set up

Hidden="true"
for the initially activated tab.

supera
May 15, 2012, 11:47 AM
Hi Daniil!

Setting 'hide' property as true, works very fine!

Thanks a lot.