cancel
Showing results for 
Search instead for 
Did you mean: 

cannot able to use iframe

former_member1193316
Participant
0 Kudos

Hi,

In my application, i pleace ifram and bind to a context attribute of type string.

created a model with export parameter of type xstring. now i wanna convert this xstring to string and dispaly pdf in iframe.

i used below code to convert xstringtostring

String url = "";

WDWebResourceType webResType = WDWebResourceType.PDF;

IWDWebResource webResource = WDWebResource.getWebResource(doc_content, webResType);

try {

url = webResource.getURL();

} catch (WDURLException e) {

e.printStackTrace();

}

return url;

but its throgunig null pointer exception

when i use below code without iframe, i can see the pdf which is opening in external window

byte[] pdfContent = wdContext.currentXtstingElement().getE_Xstring();

String pdfFileName = "Test";

WDDeployableObjectPart objpart=wdThis.wdGetAPI().getComponent().getDeployableObjectPart();

IWDCachedWebResource pdfResource= WDWebResource.getPublicCachedWebResource(pdfContent,WDWebResourceType.PDF,WDScopeType.APPLICATION_SCOPE,objpart,"Page1");

try {

wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(),pdfFileName).show();

}

catch (WDURLException e)

{ wdComponentAPI.getMessageManager().reportException(e.getMessage(),false); }

but i dont want to open in external window. how to do dat

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Venkat,

Try like this:

Comment the below code

try {

wdComponentAPI.getWindowManager().createNonModalExternalWindow(pdfResource.getURL(),pdfFileName).show();

}

catch (WDURLException e)

Create a context attribute url

wdContext.currentContextElement().setURL(pdfResource.getURL());

Create IFrame UI Element. Bind its source property with this url.

source url

Regards,

Siva

Answers (0)