Sep 14, 2012, 9:08 AM
Show and hide Tabs in TabPanel error
Hi,
I have a error when I try to show/hide Tabs in TabPanel via code.
I have a panel on the left and I want that when I expand or collapse his item the Tabs in TabPanel show/hide.
The solution work if I define the panel as:
"Ext is not defined"
Here is my complete code:
Have you any suggestion?
Thank you very much!
Stefano Lonati
I have a error when I try to show/hide Tabs in TabPanel via code.
I have a panel on the left and I want that when I expand or collapse his item the Tabs in TabPanel show/hide.
The solution work if I define the panel as:
<ext:Panel id="Test" Title="Test" runat="server" Border="false" BodyPadding="6" Icon="User" Closable="true" CloseAction="Hide" />
but work only a few times and then crash if I define the panel as:<ext:Panel id="Test" Title="Test" runat="server" Border="false" BodyPadding="6" Icon="User" Closable="true" CloseAction="Hide">
<Loader mode="Frame" ID="LoaderConfigUsersTest" runat="server" Url="Configurations/ConfigUsers.aspx">
<LoadMask ShowMask="true" />
</Loader>
</ext:Panel>
In the second case i receive the JS error:"Ext is not defined"
Here is my complete code:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ApplicationConfig.aspx.cs" Inherits="WEB_CAR.ApplicationConfig" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<ext:ResourceManager ID="ResourceManagerMain" runat="server" />
<ext:Toolbar ID="ToolbarMain" runat="server" onload="ToolbarMain_Load" />
<div class="main">
<ext:Viewport runat="server" Layout="BorderLayout" StyleSpec="background-color: transparent;" >
<Items>
<ext:Panel ID="GroupsConfig" runat="server" Title=" Groups" Region="West" Layout="AccordionLayout" Width="150" MinWidth="130" MaxWidth="300" Frame="true"
Split="true"
Collapsible="true"
Margins="135 0 25 15">
<Items>
<ext:Panel ID="pnlMasterData" runat="server" Title="Master data" Border="false" BodyPadding="6" Icon="Cog" Collapsed="false">
<Listeners>
<Expand Handler="#{TabPanelItems}.addTab(#{Test});"></Expand>
<Collapse Handler="#{TabPanelItems}.closeTab(#{Test});"></Collapse>
</Listeners>
<Items>
<ext:FieldContainer ID="FieldContainer1" runat="server" AnchorHorizontal="100%" Layout="VBoxLayout">
<Defaults>
<ext:Parameter Name="margins" Value="6 3 0 7" Mode="Value" />
</Defaults>
<Items>
<ext:Button ID="lblUsers" runat="server" Text="Users" Icon="User" Margins="12 3 0 7" Flat="true" Width="115" TextAlign="Left" OnClientClick="#{TabPanelItems}.setActiveTab(#{PanelConfigUsers})" />
<ext:Button ID="lblUserGroups" runat="server" Text="UserGroups" Icon="Group" Flat="true" Width="115" TextAlign="Left" OnClientClick="#{TabPanelItems}.setActiveTab(#{PanelConfigUserGroups})" />
<ext:Button ID="lblCurrencies" runat="server" Text="Currencies" Icon="Money" Flat="true" Width="115" TextAlign="Left" OnClientClick="#{TabPanelItems}.setActiveTab(#{PanelConfigCurrencies})" />
<ext:Button ID="lblProjectTypes" runat="server" Text="Project types" Icon="NoteEdit" Flat="true" Width="115" TextAlign="Left" OnClientClick="#{TabPanelItems}.setActiveTab(#{PanelConfigProjectTypes})" />
<ext:Button ID="lblLedgers" runat="server" Text="Ledgers" Icon="ServerDatabase" Flat="true" Width="115" TextAlign="Left" OnClientClick="#{TabPanelItems}.setActiveTab(#{PanelConfigLedgers})" />
<ext:Button ID="lblProductLines" runat="server" Text="Product lines" Icon="ServerWrench" Flat="true" Width="115" TextAlign="Left" OnClientClick="#{TabPanelItems}.setActiveTab(#{PanelConfigProductLines})" />
</Items>
</ext:FieldContainer>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
<ext:TabPanel ID="TabPanelItems" runat="server" Region="Center" Margins="135 15 25 0">
<Items>
<ext:Panel id="Test" Title="Test" runat="server" Border="false" BodyPadding="6" Icon="User" Closable="true" CloseAction="Hide">
<Loader mode="Frame" ID="LoaderConfigUsersTest" runat="server" Url="Configurations/ConfigUsers.aspx">
<LoadMask ShowMask="true" />
</Loader>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>
</div>
</asp:Content>
Have you any suggestion?
Thank you very much!
Stefano Lonati