Oct 21, 2010, 4:01 PM
[CLOSED] [0.8.2] Adding new Tab from Tab into a TabPanel problem
Hi!
Today I got another problem.
As you can see in this thread title, I need add a tab from another tab into a tabpanel. I load "Inicio" tab with AutoLoad.
Look at this code.
Default.aspx
----------------
-------------
------------
Waiting for your reply,
FVNoel
Today I got another problem.
As you can see in this thread title, I need add a tab from another tab into a tabpanel. I load "Inicio" tab with AutoLoad.
Look at this code.
Default.aspx
----------------
<!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 id="Head1" runat="server">
<title></title>
<script type="text/javascript">
function addTab(tabPanel, id, titulo, url) {
var tab = tabPanel.getComponent(id);
if (!tab) {
tab = tabPanel.add({
id: id,
title: titulo,
closable: true,
autoLoad: {
showMask: true,
url: url,
mode: 'iframe',
maskMsg: 'Cargando ' + titulo + '...'
}
});
tabPanel.setActiveTab(tab);
}
else {
tabPanel.setActiveTab(tab);
tab.reload(true);
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="SM" runat="server" />
<ext:ScriptManager ID="cSM" runat="server" Style="display: none" />
<ext:ViewPort ID="ViewPort1" runat="server">
<Body>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<North>
</North>
<West>
</West>
<Center>
<ext:TabPanel ID="TabPanel1" runat="server" EnableTabScroll="True" Title="TabPanel1">
<Tabs>
<ext:Tab ID="Inicio" Icon="HouseStar" Title="Inicio">
<AutoLoad Url="Inicio.aspx" Mode="IFrame" MaskMsg="Cargando Página de Inicio..." ShowMask="true">
</AutoLoad>
</ext:Tab>
</Tabs>
<Plugins>
<ext:TabCloseMenu ID="TabCloseMenu1" runat="server" CloseOtherTabsText="Cerrar las demás pestañas" CloseOtherTabsIcon="ApplicationCascade" CloseTabText="Cerrar esta pestaña" CloseTabIcon="Application" />
</Plugins>
</ext:TabPanel>
</Center>
</ext:BorderLayout>
</Body>
</ext:ViewPort>
</form>
</body>
</html>
Inicio.aspx-------------
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Ciber/recursos/masters/SiteBase.Master" CodeBehind="Inicio.aspx.vb" Inherits="intranetsCiber.Inicio" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderCentro" runat="server">
<div>
<asp:Panel ID="NuevoPedido" runat="server" >
<li>
<ext:LinkButton ID="NuevoPedidoLink" runat="server" Flat="true" Text="Nuevo Pedido" >
<Listeners>
<Click Handler="top.addTab(#{TabPanel1}, 'Nuevo Pedido', 'Nuevo Pedido', 'compras/comprasForm.aspx');"/>
</Listeners>
</ext:LinkButton>
</li>
</asp:Panel>
</div>
</asp:Content>
SiteBase.Master------------
<!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 id="Head1" runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server" enctype="multipart/form-data" method="post">
<asp:ScriptManager ID="SM" runat="server" />
<ext:ScriptManager ID="cSM" runat="server" Style="display: none" AjaxMethodNamespace="Metodos" CleanResourceUrl="false">
</ext:ScriptManager>
<asp:ContentPlaceHolder ID="ContentPlaceHolderCentro" runat="server">
</asp:ContentPlaceHolder>
<br/>
<asp:Label ID="LabelDebug" runat="server" ForeColor="Red"></asp:Label>
</form>
</body>
</html>
After click In NuevoPedidoLink firebug shows that:tabPanel is null
var tab = tabPanel.getComponent(id);
I'm getting crazy with that, help please!Waiting for your reply,
FVNoel
Last edited by Daniil; Oct 22, 2010 at 7:24 AM.
Reason: Please use [CODE] tags, [CLOSED]