Skip to Content

cannot able to use iframe

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jan 24, 2009 at 03:44 AM

    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

    Add comment
    10|10000 characters needed characters exceeded