[CLOSED] Tab Refreshes when activated

  1. #1

    [CLOSED] Tab Refreshes when activated

    Hey,
    On click of a button, I call the following code :

         var addTab = function(parent, selected_patient) {
                var pname = selected_patient.get('patient_name');
                var pno = selected_patient.get('patient_no_with_area');
    
                var url = "http://conference.polypathy.com?pno=" + pno;
                var tab = String.format("<iframe width='100%' height='100%' src='{0}' frameborder='0'></iframe>", url);
                parent.add({ title: pname, closable: true, html: tab,id:pno }).show();
            }
    The tab is added successfully to the tabpanel. If I open 2 such tabs, and click on the 2nd one and go back to 1st one, it refreshes its content. Basically Autopostback whenever the tab is made Active. How do I disable it in this scenario?

    Thanks,
  2. #2

    RE: [CLOSED] Tab Refreshes when activated

    Any solution to this post??
  3. #3

    RE: [CLOSED] Tab Refreshes when activated

    Hi Amit,

    I made the following sample in an attempt to try and re-create the problem, but so far everything appears to be working well.

    Can you run the following example and modify to demonstrate how to reproduce the problem.

    Example (Parent.aspx)

    [CODE]<%@ Page Language="C#" %>

    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" 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 id="Head1" runat="server">
    <title>Add Tab (Client-Side) - Coolite Toolkit Examples</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager2" runat="server" />

    <script type="text/javascript">
    var addTab = function () {
    var index = TabPanel1.items.length;
    var id = "Tab" + index;
    var title = "Tab " + index;
    var tab = TabPanel1.add({ id: index, title: title, closable: true });
    TabPanel1.setActiveTab(tab);
    tab.loadIFrame("Child.aspx");
    }
    </script>

    <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Height="300" Width="500">
    <TopBar>
    <ext:Toolbar ID="ToolBar1" runat="server">
    <Items>
    <ext:Button ID="Button1" runat="server" Text="Add Tab" Icon="Add">
    <Listeners>
    <Click Fn="addTab" />
    </Listeners>
    </ext:Button>
    </Items>
    </ext:Toolbar>
    </TopBar>
    <Tabs>
    <ext:Tab ID="Tab0" runat="server" Title="Tab 0">
    <AutoLoad2 Url="Child.aspx" Mode="IFrame" />
    </ext:Tab>
    </Tabs>
    </ext:TabPanel>
    </form>
    </body>
    </html>[CODE]

    Example (Child.aspx)

    <%@ Page Language="C#" %>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Example Page</title>
    </head>
    <body>
        <%= DateTime.Now.ToLongTimeString() %>
    </body>
    </html>
    Hope this helps.

    Geoffrey McGill
    Founder
  4. #4

    RE: [CLOSED] Tab Refreshes when activated

    Hi Amit,

    I'm looking to mark this thread as [CLOSED]. Were you able to reproduce the iframe reloading when the Tab becomes active?


    Geoffrey McGill
    Founder
  5. #5

    RE: [CLOSED] Tab Refreshes when activated

    Naah it does'nt work.

    But I think I have narrowed down the problem.

    Add a flash object in the tab iFrame. The tab when made active wont refresh the page, it just loads the flash object again.


  6. #6

    RE: [CLOSED] Tab Refreshes when activated

    Confirmed with 2 other flash objects and non flash object. Nothing refreshes except Flash object.

    Thanks,
  7. #7

    RE: [CLOSED] Tab Refreshes when activated

    yes, once a Flash object is embedded in an iframe, then there are issues because of browser/flash bugs. The following forum thread discusses the problem, see*http://extjs.com/forum/showthread.php?t=31461

    You can also try setting the hideMode: "visibility" on the TabPanel/Tabs.


    Example


    <ext:Tab ID="Tab1" runat="server" Title="Tab 1" Html="Tab 1" HideMode="Visibility" />

    Hope this helps.


    Geoffrey McGill
    Founder
  8. #8

    RE: [CLOSED] Tab Refreshes when activated

    So far it worked.

    Thanks,

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. [CLOSED] Label Editor ComboBox Jumps to left when Editor activated
    By IanPearce in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 19, 2011, 1:31 PM
  3. Form doesn't read data unless activated
    By paul-2011 in forum 1.x Help
    Replies: 2
    Last Post: Jun 30, 2011, 7:43 PM
  4. Replies: 4
    Last Post: Apr 14, 2010, 4:12 PM

Posting Permissions