[CLOSED] TabPanel and Iframe

  1. #1

    [CLOSED] TabPanel and Iframe

    Hi

    I have a Tab with a panel such as

    
      <ext:Panel ID="Panel1" runat="server" Header="false" BodyPadding="3" Flex="1" Border="false" Hidden="false">
        <Loader runat="server" Url="" Mode="Frame" AutoLoad="false">
          <%--<LoadMask ShowMask="true" />   --%> 
        </Loader>
      </ext:Panel>
    I then set the URL to something heavy like a PDF (in this case adobe pdf viewer plugin loads in browser). I have also seen this same problem when setting the URL to a local UNC address.

    The problem is that when I switch back to a previous tab the PDF is still visible, if I close the window containing the tabs then again the PDF is still visible however if I were to close the window while tab containing the PDF was still active then the PDF is no longer overlayed (window is simply hidden).

    Chrome no problem but IE (10) not so
    Last edited by fabricio.murta; Aug 28, 2017 at 8:38 PM.
  2. #2
    You can close this and worked around it by not using a loader / iframe and writing the into an object tag.
    For those who come across this problem here is what I did.

    
     <ext:Panel ID="pnlDoc" runat="server" Header="false" BodyPadding="3" Flex="1" Border="false" Hidden="true" >
      <Content>
       <div id="container"><div>                
      </Content>
     </ext:Panel>
    
            App.direct.ctlDocViewer.LoadForm(record.data.DocNum, {
                success: function (result) {
                    if (filetype == 1) {
                        var url = 'Handlers/Docs.ashx?docid=' + record.data.DocNum + "&type=1";
    
                        // Old -- set the iframe
                        //App.ctlDocViewer_ctlDocDisp_pnlDoc.getLoader().load({ url: url })
    
                        // New set the object
                        document.getElementById("ctlDocViewer_ctlDocDisp_pnlDoc-innerCt").innerHTML = '<div id="container" style="height:100%; width:100%"><object type="application/pdf" data=' + url + ' style="height:100%; width:100%"></object><div>';
    
                    }
                    Ext.net.Mask.hide();
    
                }
    
            });
    Seems to work ok on IE10 and Chrome with the Adobe pdf plugin.
  3. #3
    Hello @CanopiusApplications!

    This is really a difficult aspect to handle as we can't guarantee if people will have the adobe flash plugin on their browsers and if the browser will be using an adobe plug in (which can be from 3rd parties) that behaves the way we expect.

    Maybe the best way with that if your solution (thanks for providing us with what worked for you!) would using a JavaScript library to ensure the PDF output will be handled the same way across browsers. If you're curious on that, give the forums a search, there's a thread here covering roughly the usage of a javascript library to encapsulate this content to the page and have a proper handling. We can't really provide further support over third-party javascript libraries though, so it is left just as a suggestion on ways to go. And by now there may be better libraries available over there.

    If you are curious on the subject and can't find the thread, let us know.
    Fabrício Murta
    Developer & Support Expert
  4. #4
    Hi Fabricio

    Yeah I appreciate the difficulties with the various 3rd party plugins knocking about. For the sake of this thread though the browser version / plugin is not a problem as I control all of that (internal app) so in this case the c# handler and writing the stream directly into the object tags fits best although for extranet/internet I would probably do it slightly differently.

    I played with a few other options.

    1. PDF.js -- World of pain here but works (sort of). My main problems here were that it only opened 7/10 of our MFD produced PDF's and biggest of all it was much slower than the Adobe OCX. I would certainly revisit this for deployments to the wild.

    2. DevExpress -- did not really like the idea of conversion to image and displaying that.

    Thanks for responding,
    D

Similar Threads

  1. Tabpanel and IFrame and data
    By glenh in forum 2.x Help
    Replies: 0
    Last Post: Sep 11, 2012, 10:39 PM
  2. [1.0] Tabpanel + iframe + layout
    By SouthDeveloper in forum 1.x Help
    Replies: 0
    Last Post: May 13, 2010, 9:32 PM
  3. ?? tabpanel iframe ????????!
    By guoweidong in forum 1.x Help
    Replies: 2
    Last Post: Apr 22, 2010, 11:32 PM
  4. Tabpanel Iframe page
    By vali1993 in forum 1.x Help
    Replies: 2
    Last Post: Feb 22, 2010, 3:56 PM
  5. Refresh combobox in iFrame from TabPanel
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Nov 15, 2009, 3:26 PM

Posting Permissions