PDA

View Full Version : [CLOSED] My aspx Pages are not rendered into the ext:tabPanel in Mainpage



supera
Feb 17, 2012, 10:57 AM
Hi!

I have a MainPage with tabPanel and a toolbar.
When I click in buttons of toolbar, my aspx pages should be loaded in tabPanel.
But this don't occurs.
The page_load event of my aspx page are triggered, but the page are not rendered.
So, the panel of tabpanel are empty.

I try follow this example.
http://examples2.ext.net/#/TabPanel/Basic/Add_Tabs/

I made a little example to demonstrate my difficulty.
Someone could take a look and tell me what i doing wrong?

Thanks for any help!


MainPage


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test7.aspx.vb" Inherits="WebApplication3.Test7" %>
<%@ 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>Tab loaded as blank</title>
<ext:XScript ID="XScript1" runat="server">
<script type="text/javascript">
var addTab = function (tabPanel, contextID, Title) {
var tab = tabPanel.getComponent(contextID);

if (!tab) {
tab = tabPanel.add({
id: contextID,
title: Title,
closable: true,
loader: {
url: "./test8.aspx?ContextID=" + contextID,
loadMask: {
showMask: true,
msg: "carregando " + Title + "..."
}
}
});
}

tabPanel.setActiveTab(tab);
};
</script>
</ext:XScript>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="resManagerSGCO" runat="server" Namespace="SuperaWeb.SGCO" />
<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel ID="tabHeader" runat="server" Region="North" Border="false" Height="40px">
<Content>
<div id="header-console">
<div id="h1-console">
<span id="titleempresanome" class="title-empresa-nome" style="position:fixed; top:5px; left:20px;">SuperaWeb(r)</span>
</div>
</div>
</Content>
</ext:Panel>
<ext:Panel ID="panelLeft" runat="server" Region="East" Collapsible="true" Collapsed="true" CollapseMode="Mini" Split="true" HideCollapseTool="true" Layout="AccordionLayout" MinWidth="250" MaxWidth="500">
<Items>
<ext:Panel ID="panelTasks" runat="server" title="Tarefas" Icon="NoteAdd" />
<ext:Panel ID="panelNotes" runat="server" title="Notas" Icon="Note"/>
<ext:Panel ID="panelMural" runat="server" title="Mural" Icon="NoteGo" Layout="FitLayout"/>
</Items>
</ext:Panel>
<ext:Panel ID="panelCenter" runat="server" Region="Center" Flex="1" layout="FitLayout" BodyPadding="6">
<TopBar>
<ext:DesktopTaskBar>
<Items>
<ext:Button runat="server" ID="btEmpresas" Text="Empresas" Icon="ApplicationAdd">
<Listeners>
<Click Handler="addTab(#{tabWebExplorer}, 'Empresas', 'Empresas');" />
</Listeners>
</ext:Button>
<ext:Button runat="server" ID="btEmpresas_Classes" Text="Classe de Empresas" Icon="ApplicationAdd">
<Listeners>
<Click Handler="addTab(#{tabWebExplorer}, 'Empresas.Classes', 'Classe de Empresas');" />
</Listeners>
</ext:Button>
<ext:Button runat="server" ID="btEmpresas_Categorias" Tooltip="Categoria de empresas" Icon="ApplicationAdd">
<Listeners>
<Click Handler="addTab(#{tabWebExplorer}, 'Empresas.Categorias', 'Categorias de Empresas');" />
</Listeners>
</ext:Button>
</Items>
</ext:DesktopTaskBar>
</TopBar>
<Items>
<ext:TabPanel ID="tabWebExplorer" runat="server" Plain="true" Flex="1" Layout="FitLayout">
<Items>
<ext:Panel runat="server" ID="paneMyPage" Title="MyPage" Icon="ApplicationHome">
</ext:Panel>
</Items>
<Plugins>
<ext:TabScrollerMenu ID="TabScrollerMenu1" runat="server" PageSize="90" />
</Plugins>
</ext:TabPanel>
</Items>
</ext:Panel>
<ext:StatusBar runat="server" ID="stbSGCO" Region="South" StatusAlign="Right">
<Items>
<ext:ToolbarTextItem runat="server" ID="txtEmpresaLogada" Text="EmpresaLogada" />
<ext:ToolbarSeparator ID="ToolbarSeparator5" runat="server" />
<ext:ToolbarTextItem runat="server" ID="txtServerName" Text="ServerName" />
<ext:ToolbarSeparator ID="ToolbarSeparator2" runat="server" />
<ext:ToolbarTextItem runat="server" ID="txtDataBaseName" Text="DatabaseName" />
<ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
<ext:Button runat="server" ID="btnUsuarioLogado" Text="User" Icon="User">
<Menu>
<ext:Menu runat="server" ID="mnUsuarioLogado" Icon="UserAlert">
<Items>
<ext:MenuItem runat="server" ID="mnUsarioLogadoExit" text="Sair" Icon="UserDelete"/>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
<ext:ToolbarSeparator ID="ToolbarSeparator4" runat="server" />
<ext:ToolbarFill runat="server" ID="tbfill100" />
<ext:ToolbarSeparator ID="ToolbarSeparator3" runat="server" />
<ext:Button runat="server" ID="btnMural" Text="Mural" Icon="NoteGo" />
<ext:ToolbarSeparator ID="ToolbarSeparator6" runat="server" />
<ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" text="teste" />
</Items>
</ext:StatusBar>
</Items>
</ext:Viewport>
<ext:Hidden runat="server" ID="txtIDEmpresa" Text="0" />
</form>
</body>
</html>


Aspx pages


<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Test8.aspx.vb" Inherits="WebApplication3.Test8" %>
<%@ 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">

<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim mb As New Ext.Net.MessageBox
mb.Alert("TEST8.ASPX PAGE_LOAD", "TEST8.ASPX PAGE_LOAD." & vbCrLf & "CONTEXTID: " & Request("ContextID"))
mb.Show()
MsgBox("teste")
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<ext:ResourceManager ID="resManagerSGCO" runat="server" Namespace="SuperaWeb.ExplorerWeb" Locale="pt-BR" />
<form id="form1" runat="server">
<ext:Viewport runat="server" ID="viewPort2">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel runat="server" ID="panelExplorerWebTab" Layout="FitLayout" Flex="1">
<TopBar>
<ext:Toolbar ID="tbWebExplorer" runat="server">
<Items>
<ext:Button ID="btnAdd" runat="server" Icon="ApplicationAdd" Text="Adicionar" ToolTip="Adicionar registro" />
<ext:Button ID="btnEdit" runat="server" Icon="ApplicationEdit" Text="Editar" ToolTip="Editar registro selecionado" />
<ext:Button ID="btnDelete" runat="server" Icon="ApplicationDelete" Text="Excluir" ToolTip="Deletar registro(s) selecionados" />
<ext:Button ID="btnFind" runat="server" Icon="Find" Text="Localizar" ToolTip="Localizar registro" >
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:ComboBox ID="cmbSearchField" runat="server" Editable="false" FieldLabel="Pesquisar em" LabelWidth="80" Width="265"/>
<ext:ComboBox ID="cmbSearchMatch" runat="server" Editable="false" FieldLabel="Coincidir" LabelWidth="80" Width="265">
<Items>
<ext:ListItem Text="Qualquer parte" Value="Qualquer parte" />
<ext:ListItem Text="Início" Value="Início" />
<ext:ListItem Text="Exatamente" Value="Exatamente" />
</Items>
<SelectedItems>
<ext:ListItem Text="Qualquer parte" />
</SelectedItems>
</ext:ComboBox>
<ext:TriggerField ID="txtSearchValue" runat="server" FieldLabel="O quê?" LabelWidth="80" Width="265" EmptyText="texto/valor a ser pesquisado" >
<Triggers>
<ext:FieldTrigger Icon="Search" />
</Triggers>
</ext:TriggerField>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
<ext:ToolbarSeparator ID="tbSeparator1" runat="server" />
<ext:Button ID="btnPrint" runat="server" Icon="Printer" Text="Imprimir" ToolTip="Imprimir registros" />
<ext:Button ID="btnPrintPreview" runat="server" Icon="PrinterGo" Text="Visualizar impressão" ToolTip="Visualizar impressão registros" />
<ext:ToolbarSeparator ID="tbSeparator2" runat="server" />
<ext:SplitButton ID="btnExport" runat="server" Icon="PageExcel" Text="Exportar" ToolTip="Exportar registros para..." >
<menu>
<ext:Menu runat="server" ID="mnExport">
<Items>
<ext:MenuItem ID="mnuExportToExcel" runat="server" icon="PageExcel" Text="Excel" />
<ext:MenuItem ID="mnuExportToWord" runat="server" icon="PageWord" Text="Word" />
<ext:MenuItem ID="mnuExportToPdf" runat="server" icon="PageWhiteAcrobat" Text="PDF" />
<ext:MenuItem ID="mnuExportToXml" runat="server" icon="PageCode" Text="Xml" />
</Items>
</ext:Menu>
</menu>
</ext:SplitButton>
<ext:ToolbarFill ID="tbf1" />
<ext:ComboBox ID="cmbQueries" runat="server" Editable="false" FieldLabel="Consultas" LabelWidth="60" />
<ext:Button ID="btnEditQueryFieldCriteriaParameterRequest" runat="server" Icon="BulletEdit" ToolTip="Clique para editar novamente os critérios da consulta"/>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:GridPanel runat="server" ID="gridPanel1" Flex="1" >
<Store>
<ext:Store runat="server" ID="Store1" IgnoreExtraFields="false" PageSize="10" RemoteSort="true" AutoLoad="false">
<Model>
<ext:Model ID="modelExplorerWebContext" runat="server">
</ext:Model>
</Model>
</ext:Store>
</Store>
<SelectionModel>
<ext:RowSelectionModel runat="server" ID="rsmExplorerWebContext" Mode="Single"/>
</SelectionModel>
<BottomBar>
<ext:PagingToolbar ID="tbPaging1" runat="server" />
</BottomBar>
</ext:GridPanel>
<ext:Hidden runat="server" ID="txtQueryKey" Text="" />
<ext:Hidden runat="server" ID="txtContextKey" Text="" />
<ext:Hidden runat="server" ID="txtContextID" Text="" />
</Items>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>

Daniil
Feb 17, 2012, 1:35 PM
Hi,

Please add

renderer : "frame"
into the loader's config.

Example

loader : {
url : "url",
renderer : "frame",
...
}

supera
Feb 17, 2012, 2:45 PM
Works fine!

Thanks a lot, Daniil.