[CLOSED] dynamic tabs do not display content

  1. #1

    [CLOSED] dynamic tabs do not display content

    this is the script:

    <%@ Page Language="C#"  %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "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 runat="server">
            protected void Page_Load(object sender, EventArgs e)
            {
                string[] titles = new string[] { "title1", "title2", "title3" };
                foreach (string title in titles)
                {
                    Coolite.Ext.Web.Tab newTab = new Coolite.Ext.Web.Tab("tab_" + title, title);
                    this.tabPanelTemplates.Tabs.Add(newTab);
    
                    Coolite.Ext.Web.FormLayout newForm = new Coolite.Ext.Web.FormLayout();
                    Coolite.Ext.Web.Checkbox newCheck = new Coolite.Ext.Web.Checkbox();
                    newCheck.ID = "chk_" + title;
                    newCheck.FieldLabel = "check";
                    newForm.Anchors.Add(Util.NewAnchor(newCheck));
    
                    Coolite.Ext.Web.TextField newText = new Coolite.Ext.Web.TextField();
                    newText.ID = "txt_" + title;
                    newText.FieldLabel = "title";
                    newForm.Anchors.Add(Util.NewAnchor(newText));
    
                    Coolite.Ext.Web.HtmlEditor newEdit = new Coolite.Ext.Web.HtmlEditor();
                    newEdit.ID = "html_" + title;
                    newEdit.FieldLabel = "content";
                    newForm.Anchors.Add(Util.NewAnchor(newEdit));
    
                    newTab.BodyControls.Add(newForm);
                }
            }
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server">
            </ext:ScriptManager>
            
                    <ext:TabPanel ID="tabPanelTemplates" runat="server" EnableTabScroll="true" Border="false">
                        <Tabs>
                        </Tabs>
                    </ext:TabPanel>
        </form>
    </body>
    </html>
    when I run it, all three tabs are created but only the first one contains any controls although in the response everything seems fine:

    Ext.onReady(function(){this.tabPanelTemplates=new Ext.TabPanel({id:"tabPanelTemplates",monitorResize
    :true,renderTo:"tabPanelTemplates_Container",border:false,items:[{id:"tab_title1",monitorResize:true
    ,layout:"form",anchorSize:{isFormField:false},itemCls:"",items:[{id:"chk_title1",xtype:"checkbox",fieldLabel
    :"check",inputValue:"chk_title1"},{id:"txt_title1",xtype:"textfield",fieldLabel:"title"},{id:"html_title1"
    ,xtype:"htmleditor",fieldLabel:"content"}],title:"title1"},{id:"tab_title2",monitorResize:true,layout
    :"form",anchorSize:{isFormField:false},itemCls:"",items:[{id:"chk_title2",xtype:"checkbox",fieldLabel
    :"check",inputValue:"chk_title2"},{id:"txt_title2",xtype:"textfield",fieldLabel:"title"},{id:"html_title2"
    ,xtype:"htmleditor",fieldLabel:"content"}],title:"title2"},{id:"tab_title3",monitorResize:true,layout
    :"form",anchorSize:{isFormField:false},itemCls:"",items:[{id:"chk_title3",xtype:"checkbox",fieldLabel
    :"check",inputValue:"chk_title3"},{id:"txt_title3",xtype:"textfield",fieldLabel:"title"},{id:"html_title3"
    ,xtype:"htmleditor",fieldLabel:"content"}],title:"title3"}],enableTabScroll:true,activeTab:0});tabPanelTemplates
    .doLayout();Coolite.Ext.lazyInit(["chk_title1","txt_title1","html_title1","tab_title1","chk_title2","txt_title2"
    ,"html_title2","tab_title2","chk_title3","txt_title3","html_title3","tab_title3"]);Coolite.Ext.setValues
    ([[txt_title1,""],[txt_title2,""],[txt_title3,""]]);tabPanelTemplates.on("beforetabchange",function(el
    ,newTab){this.getActiveTabField().setValue(el.items.indexOf(newTab));});});Ext.QuickTips.init();Coolite
    .Ext.ScriptManagerUniqueID="ScriptManager1";Ext.BLANK_IMAGE_URL="/ALA/extjs/resources/images/default
    /s-gif/coolite.axd";
  2. #2

    RE: [CLOSED] dynamic tabs do not display content

    Hi,

    Try to set Height for TabPanel and LayoutOnTabChange=true 
  3. #3

    RE: [CLOSED] dynamic tabs do not display content

    ok, setting the Height makes it display but the problem is I have no way to make it fit the whole layout.

    Anyway, if I put the tabs in a window (which is what I wanted to do in the first place) it works fine. So I guess you have to include it in some other structure with a fixed Height and then there is no problem
  4. #4

    RE: [CLOSED] dynamic tabs do not display content

    Hi,

    In mostly cases you need to set fixed height for control or put it inside any layout which controls items size. Otherwise you will get some issues like you described

Similar Threads

  1. [CLOSED] TabPanels: Unable to display content from tab even when activated
    By wisdomchuck in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 14, 2012, 1:45 PM
  2. Replies: 1
    Last Post: Jan 16, 2012, 5:00 PM
  3. Replies: 3
    Last Post: Jun 22, 2011, 7:37 PM
  4. Replies: 2
    Last Post: Jan 21, 2011, 12:53 PM
  5. Replies: 3
    Last Post: Jul 14, 2009, 9:47 PM

Posting Permissions