[CLOSED] display PDF in TabPanel

  1. #1

    [CLOSED] display PDF in TabPanel



    is it possible to display a PDF or Word Doc inside a TabPanel. I am trying to use an iframe inside a TabPanel but my PDF does not display. any suggestions.
    thanks
  2. #2

    RE: [CLOSED] display PDF in TabPanel



    Did you try an ext:FitLayout around your iFrame to stretch the contents to the borders of the TabPanel?


    Also, a small snippet of code would be helpful.
  3. #3

    RE: [CLOSED] display PDF in TabPanel

    thank you. that is working. what is the purpose of
     <ext:FitLayout>
  4. #4

    RE: [CLOSED] display PDF in TabPanel

    Hi idrissb,

    If you set the .AutoLoad property with a url that starts with "http", an <iframe> will be automatically created inside the <Content> region and loaded with that url.

    Example

    <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Height="300" Width="800">
        <Tabs>
            <ext:Tab runat="server" Title="Tab 1" Html="Switch to Tab2" />
            <ext:Tab 
                runat="server" 
                Title="Tab 2" 
                AutoLoad="http://ext.net/license/commercial/Coolite-Commercial-License-Agreement.pdf" 
                />
        </Tabs>
    </ext:TabPanel>
    Behind the scenes, the .AutoLoad property is just setting the .Html property with an <iframe>.

    Example

    this.Html = string.Format("<iframe width=\"100%\" id=\"{1}_iframe\" height=\"100%\" src=\"{0}\" frameborder=\"0\"></iframe>", (string)value, this.ClientID);
    Hope this helps.

    Geoffrey McGill
    Founder & CEO
  5. #5

    RE: [CLOSED] display PDF in TabPanel


    Thanks Geoffrey!

    Learned something new.
  6. #6

    RE: [CLOSED] display PDF in TabPanel

    thank you for your help. it is working as intented on IE.
    if I take the code you showed earlier
    <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Height="300" Width="800">
        <Tabs>
            <ext:Tab runat="server" Title="Tab 1" Html="Switch to Tab2" />
            <ext:Tab 
                runat="server" 
                Title="Tab 2" 
                AutoLoad="http://ext.net/license/commercial/Coolite-Commercial-License-Agreement.pdf" 
                />
        </Tabs>
    </ext:TabPanel>

    on IE, If I switch to the other tab and then return to Tab1, the pdf is still display.
    On FF3, Tab1 displays the PDF then select Tab2, go back to Tab1 no PDF displayed.
    Am I missing something.
    this is the center panel I am using just in case

    
    
    <Center>
    
    <ext:TabPanel ID="CenterPanel" runat="server" ActiveTab="0" ActiveTabIndex="0" >
    
    <Tabs>
    
    <ext:Tab ID="CenterTab1" runat="server" Title="Tab 2" AutoLoad="http://ext.net/license/commercial/Coolite-Commercial-License-Agreement.pdf" />
    
    
    
    <ext:Tab ID="Tab1" runat="server" Title="Center" Border="false" BodyStyle="padding:6px;">
    
    <Content> 
    
    <ext:FitLayout runat="server">
    
    <ext:Panel ID="Panel3" runat="server" Height="450px" Title="Google" Width="600px"
    
    Html="<iframe id='Panel3_IFrame' width='100%' height='100%' src='reports/mole.pdf' frameborder='0'></iframe>" />
    
    </ext:FitLayout>
    
    </Content>
    
    </ext:Tab>
    
    <ext:Tab ID="Tab4" runat="server" Title="Event Tab" Html="I am tab 3's content. I also have an event listener attached."
    
    BodyStyle="padding: 6px;" AutoScroll="true">
    
    <Listeners>
    
    <Activate Handler="handleActivate" />
    
    </Listeners>
    
    </ext:Tab>
    
    </Tabs>
    
    </ext:TabPanel>
    
    </Center>
    </PRE>

Similar Threads

  1. Replies: 5
    Last Post: Aug 13, 2012, 1:33 PM
  2. [CLOSED] Ext.Net's tabpanel and ExtJs tabpanel anchor
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 21, 2011, 11:57 AM
  3. Replies: 3
    Last Post: Aug 21, 2009, 2:24 PM
  4. [CLOSED] Tabpanel + Gridpanel: display issue
    By reinout.mechant@imprss.be in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jun 26, 2009, 9:58 AM
  5. [CLOSED] Tabpanel in tabpanel from code behind
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Oct 29, 2008, 7:56 AM

Posting Permissions