cancel
Showing results for 
Search instead for 
Did you mean: 

Non-Model External window issues

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (4)

Answers (4)

nikhil_bose
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

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

Thanks,

Tulasi

Former Member
0 Kudos

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

Former Member
0 Kudos

It didn't work V. Kong, as I mentioned I even can't open simple web URL in external non-model window,

open() is deprecated and show() is the recommended method.

Former Member
0 Kudos

Hi,

The way you are doing is correct but it is not clear what is the exact reason behind this. Just try using createExternalWindow method and see if that works or no.

Regards,

Murtuza

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Try this

pdfWindow.open(); 

instead of

pdfWindow.show();

Regards,

P.Manivannan

Former Member
0 Kudos

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.