cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with IWDCachedWebResource

Former Member
0 Kudos

I'd like to use the CachedWebResource to display a pdf in an IFrame/external window/etc, but am having issues...

1) The pdf never shows up in the IFrame or external window... Only a blank screen. I can change the resource type to XML and use an xml file, and it works fine. What am I missing?

public void onPlugIn(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
 //@@begin onPlugIn(ServerEvent)
 IWDCachedWebResource cachedResource = null;
 String pdfUrl = null;
 byte[] pdf = <i><get the file></i>;
 if (pdf != null) {
   cachedResource = WDWebResource.getWebResource(pdf, WDWebResourceType.PDF);
   try {
     pdfUrl = cachedResource.getURL();
     wdContext.currentContextElement().setUrl(pdfUrl);
   }
   catch (WDURLException e) {
     IWDMessageManager mgr = wdComponentAPI.getMessageManager();
     mgr.reportException(e.getLocalizedMessage(), true);
   }
 }
 //@@end
}

2) When I switch the resource type to xml, and use an xml file that is very, very large (but still valid), I get the following error trying to display the CachedWebResource in the IFrame.

<b>XML document must have a top level element. Error processing resource 'http://<i><server></i>:50000/webdynpro/dispatcher/local/Rep...</b>

Are there size limitations with the CachedWebResource? Any ideas?

Thanks,

-Dave

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi David,

Did you got the solution for the problem. We are facing the same issue here.

Window popups with the empty screen. Please let me know the solution for this.

Code is perfect, but couldnt get the result.

Thanks,

Raghavendra P

Former Member
0 Kudos

hi,

Are u able to open a pdf in your browser.

I think its the problem with your browser

Regards

Bharathwaj

Former Member
0 Kudos

Yes, I can open PDF's in my browser just fine. It works fine with a file download control, but I'd rather use the cached resource so I don't have to display a separate dialog with the file download control, and have the user click one more time.

Former Member
0 Kudos

anyone?

Former Member
0 Kudos

Hello,

in I posted some source code that works for me to open an external window with a PDF showing. Drawback is that it just works the first time... maybei it helps you anyway.

Frank