load the tabpanel to dynamic title, But the title not show?

  1. #1

    load the tabpanel to dynamic title, But the title not show?












        this.Details.Header = true;
        this.Details.SetTitle(group.G_CName);
        string url = "Render.aspx?GroupID=" + groupID.ToString(); 
        LoadConfig load_config = new LoadConfig(url, LoadMode.IFrame, false);
                
        Details.LoadContent(load_config);
    </PRE>
        <Center>
            <ext:TabPanel ID="Details" runat="server" EnableTabScroll="true">
                       
            </ext:TabPanel>
        </Center>
    </PRE>
  2. #2

    RE: load the tabpanel to dynamic title, But the title not show?

    Hi,

    TabPanel has no header therefore you can't use Title. Also TabPanel should display tabs therefore it doesn't make sense use AutoLoad for TabPanel. Use Panel
    Vladimir Shcheglov
    Sr. Developer
  3. #3

    RE: load the tabpanel to dynamic title, But the title not show?


    <DIV align=left>This function show the title. why?
        var loadPage = function(tabPanel, node) {
                  //addTab(tabPanel, node.id, node.text, node.attributes.href);
                    var tab = tabPanel.getItem(node.id);
                    if (!tab) {
                        tab = tabPanel.add({
                            id: node.id,
                            title: node.text,
                            closable: true,
                            autoLoad: {
                                showMask: true,
                                url: node.attributes.href,
                                mode: 'iframe',
                                maskMsg: 'Loading ' + node.attributes.href + '...'
                            },
                            listeners: {
                                update: {
                                    fn: function(tab, cfg) {
                                        cfg.iframe.setHeight(cfg.iframe.getSize().height - 20);
                                    },
                                    scope: this,
                                    single: true
                                }
                            }
                        });
                    }
                    tabPanel.setActiveTab(tab);
                }
    </PRE>
  4. #4

    RE: load the tabpanel to dynamic title, But the title not show?

    Hi,

    This function adds new tab and activate it. How this function related with code from first post?


    I am not sure what you try accomplish and what problems do you have. May be you can provide more details?
    Vladimir Shcheglov
    Sr. Developer
  5. #5

    RE: load the tabpanel to dynamic title, But the title not show?

    The layout was the pages templete. I need load the default page.

    the following was the pages code:
        <%@ Page Language="C#" MasterPageFile="~/Manager/MasterPage/PageTemplate.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="FrameWork.web.Manager.Module.Information.Label.List" %></PRE><%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="PageBody" runat="server">
        <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>Manager/inc/FineMessBox/js/common.js"></script></PRE>    <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>Manager/inc/FineMessBox/js/subModal.js"></script>
        
        <script type="text/javascript">
            var loadPage = function(tabPanel, node) {
              //addTab(tabPanel, node.id, node.text, node.attributes.href);
                var tab = tabPanel.getItem(node.id);
                if (!tab) {
                    tab = tabPanel.add({
                        id: node.id,
                        title: node.text,
                        closable: true,
                        autoLoad: {
                            showMask: true,
                            url: node.attributes.href,
                            mode: 'iframe',
                            maskMsg: 'Loading ' + node.attributes.href + '...'
                        },
                        listeners: {
                            update: {
                                fn: function(tab, cfg) {
                                    cfg.iframe.setHeight(cfg.iframe.getSize().height - 20);
                                },
                                scope: this,
                                single: true
                            }
                        }
                    });
                }
                tabPanel.setActiveTab(tab);
            }
            
            function addTab(tabPanel, id, title, url) 
            {   
                alert("id=" + id + ";title=" + title + ";url" + url);
                var tab = tabPanel.getItem(id);
             if (!tab) 
             {                
              tab = new Ext.Panel({
                                           id: id,
                                           title: 'loading....',
                                           defaultTitle: title,
                                           closable: true,
                                           autoLoad: {                        
                                        showMask: true,                        
                                        url: url,                        
                                        mode: 'iframe',                        
                                        maskMsg: 'loading....',                        
                                        scripts: true                                            
                                       }                
                                        });                
                    var updatePanel = function(tab, resObj) 
                    {                    
                  for (var i = 0; i < window.self.frames.length; i++) 
                  {                        
                   if (window.self.frames[i].name == tab.iframe.dom.id) 
                   {                            
                    tab.autoLoad.url = window.self.frames[i].location;                            
                    var newTitle = title;                            
                    if (newTitle) 
                    {                                
                     tab.setTitle(newTitle);                            
                    }                            
                    else 
                    {                                
                     tab.setTitle( tab.defaultTitle || 'loaded' );                            
                    }                                                   
                   }                    
            }                
           }                
           tab.on('update', updatePanel);                
           tab = tabPanel.add(tab);            
             }            
          tabPanel.setActiveTab(tab);        
            }
        </script>
        <ext:ScriptManager ID="ScriptManager1" runat="server" />
        
        <ext:ViewPort ID="ViewPort1" runat="server">
            <Body>
                
                <ext:BorderLayout ID="BorderLayout1" runat="server">
                    <North>
                        <ext:Panel ID="Panel1" runat="server" Title="??????:????" Icon="Briefcase">
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server" >
                                <Items>
                                    <ext:ToolbarButton ID="Button1" runat="server" Text="????" Icon="Pencil" StandOut="true">
                                        <AjaxEvents>
                                            <Click OnEvent="Edit">
                                                <EventMask ShowMask="true" Msg="??loading??,??? ..."/>
                                            </Click>
                                        </AjaxEvents> 
                                        
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTip1" runat="server" Html="??????" />
                                        </ToolTips>
                                    </ext:ToolbarButton>
                                    
                                     <ext:ToolbarButton ID="ToolbarButton3" runat="server" Icon="Delete" StandOut="true" Text="??">
                                        <AjaxEvents>
                                            <Click OnEvent="Delete">
                                                <EventMask ShowMask="true" Msg="??????,??? ..."/>
                                            </Click>
                                        </AjaxEvents> 
                                        <ToolTips>
                                            <ext:ToolTip ID="ToolTip3" runat="server" Html="??????" />
                                        </ToolTips>
                                    </ext:ToolbarButton>
                                </Items>
                             </ext:Toolbar>
                         </TopBar>
                    </ext:Panel>
                    </North>
                    <West>
                        <ext:TreePanel ID="TreePanel1" runat="server" Width="200" Title="????" Icon="ChartOrganisation">            
                            <Listeners>
                                <Click Handler="if(node.attributes.href){e.stopEvent();loadPage(#{Details}, node);}" />
                            </Listeners>
                            <Loader>
                                <ext:PageTreeLoader OnNodeLoad="LoadPages"></ext:PageTreeLoader>
                            </Loader>
                        </ext:TreePanel>
                    </West>
                    
                    <Center>
                       <ext:TabPanel ID="Details" runat="server" EnableTabScroll="true">
                       
                       </ext:TabPanel>
                    </Center>
                </ext:BorderLayout>
            </Body>
        </ext:ViewPort>
        
    </asp:Content>

    the following was the Page_Load implement the data bind




        this.Details.Header = true;
                this.Details.FieldLabel = group.G_CName;
                string url = "Render.aspx?GroupID=" + groupID.ToString(); 
                LoadConfig load_config = new LoadConfig(url, LoadMode.IFrame, false);
                
                Details.LoadContent(load_config);
    </PRE></PRE>
  6. #6

    RE: load the tabpanel to dynamic title, But the title not show?

    Hi,

    You need create Tab, add to the TabPanel and load page into the Tab. But you load into thye TabPanel. It is incorrect.


    Please note that you can't create Tab during AjaxEvent therefore you must create tab using javascript
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. Dynamic StartMenu Title
    By archana in forum 1.x Help
    Replies: 1
    Last Post: Dec 29, 2011, 3:31 PM
  2. title in tabpanel
    By maryam in forum 1.x Help
    Replies: 3
    Last Post: Aug 21, 2010, 7:48 AM
  3. Dynamic window title
    By phillipl in forum 1.x Help
    Replies: 3
    Last Post: Dec 16, 2009, 7:03 AM
  4. TabPanel reload and title
    By izee in forum 1.x Help
    Replies: 3
    Last Post: May 19, 2009, 11:09 PM
  5. [CLOSED] tabpanel title
    By speedstepmem2 in forum 1.x Premium Help
    Replies: 1
    Last Post: Apr 24, 2009, 7:57 AM

Posting Permissions