Skip to Content
avatar image
Former Member

Non-Model External window issues

I was trying to open non-model external window but application isn't opening the window, can any body tell me whats wrong with my code:

TestReport report = new TestReport();
byte[] pdfData= report.getReportData();
						
IWDResource pdfResource = WDResourceFactory.createResource(pdfData, "TestReport.pdf", WDWebResourceType.PDF); 
String urlToFile = pdfResource.getUrl(WDFileDownloadBehaviour.AUTO.ordinal());

IWDWindow pdfWindow = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToFile, "View Report");
		
pdfWindow.show();

Actually I was trying to open pdf document in external window but nothing is opening, so I just made it simple and nothing happened.

	
IWDWindow pdfWindow = wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.yahoo.com", "View Report");
pdfWindow.show();

thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Aug 05, 2008 at 01:23 PM

    Hi,

    Try this

    pdfWindow.open(); 

    instead of

    pdfWindow.show();

    Regards,

    P.Manivannan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      pdfWindow.open() is deprecated method, instead of show() method will be used.

      Anyways I will try this but I doubt it will solve my problem.

  • avatar image
    Former Member
    Aug 05, 2008 at 06:22 PM

    Hi,

    I use the following code to display PDF file in external window

    IWDCachedWebResource resource;

    String fileName = "pdf_file_name"

    //Get PFC web resource URL, you need the PDF stream return from ABAP RFC

    resource = WDWebResource.getWebResource(wdContext.currentY_PDFElement().getPdfStream(), WDWebResourceType.PDF);

    resource.setResourceName(fileName);

    String PDF_URL = resource.getURL());

    //Open the PDF in new window

    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(resource.getURL(), "PDF File");

    window.setWindowPosition(5, 5);

    window.setWindowSize(600, 600);

    window.open();

    Hope this will helps

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I found the problem, actually it works only on IE, I was trying it on Firefox 3 before.

      My suggestion to every body use IE when using webdynpros.

      Regards,

      Jawed Ali

  • avatar image
    Former Member
    Aug 06, 2008 at 04:40 AM

    Hi

    Inplace of CreatenonmodalExternalWindow() method use creatExternalwindow() i think it will work

    Thanks,

    Tulasi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 06, 2008 at 04:59 AM

    jawed,

    IWDWindow pdfwindow = wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.google.com","google");
        pdfwindow.show();
    

    is correct.

    Not sure that why it is not showing. check the action is being called.

    try casting too

    IWDWindow pdfwindow = (IWDWindow)wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.google.com","google");
        pdfwindow.show();
    

    but this one not needed. just give a try.

    in firefox, you can set enable popups to show popup windows

    nikhil

    Edited by: Nikhil ßos on Aug 6, 2008 10:30 AM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I don't think there is any thing to do with popup blocking:

      1) when Firefox blocks a popup it intimates

      2) I have my URL added in exception list of popup blocks, so its out of question i guess

      There are control that don't run perfectly on Firefox but they run IE; I guess SAP doesn't vouch using firefox either.

      Jawed Ali