cancel
Showing results for 
Search instead for 
Did you mean: 

WebDynpro Java with HTML

Former Member
0 Kudos

Hi,

Is there is any posibility to bind context elements in webdynpro to HTML page.

regards,

kishore.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can use the following piece of code to open an HTML page. You can trigger an event on the click of a button :

String urlToDelivery = // URL such as "http://www.google.co.in" ;

if( urlToDelivery != null)

{

if( urlToDelivery.startsWith("http://"))

{

String winTitle = "<Title_for_HTML_page>" ;

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToDelivery , winTitle );

window.open();

}

else

{

wdComponentAPI.getMessageManager().reportWarning("Invalid URL: Cannot open Internet Explorer");

}

}

else

{

wdComponentAPI.getMessageManager().reportWarning("Invalid URL: Cannot open Internet Explorer");

}

This will work. Let me know if you need any more help.

Regards,

Divyata

Former Member
0 Kudos

hi Divyata,

i have worked on code sent by you. I am able to open html page in new window. but i am able to open only some standard urls. My requirement is like I have a customized html page and i want to bind the WD context elements to that HTML page, is it possible or do we have any other solution.

thanks,

kishore.

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Do one thing...

create String variable say

String htmlcontent=null;

htmlcontent="your html code";

//for example

htmlcontent="<html><table><tr><td>" + wdContextelement + "</html>";

Now, to open this,

try

{

byte[] html=new byte [ 4096 ] ;

html=strHTMLCont.getBytes("UTF-8");

IWDWindow win =wdThis.wdGetAPI().getComponent().getWindowManager()

.createNonModalExternalWindow(WDWebResource.getWebResource(html, WDWebResourceType.HTML).getURL(),"Certificate");

win.show();

}

catch(WDURLException url)

{

wdComponentAPI.getMessageManager().reportException("WDURLException::"+url.toString(),true);

}

catch(UnsupportedEncodingException e)

{

wdComponentAPI.getMessageManager().reportException("UnsupportedEncodingException"+e.toString(),true);

}

catch(Exception e)

{

wdComponentAPI.getMessageManager().reportException("Exception in creating Form"+e.toString(),true);

}

Regards,

Srinivas

Edited by: srinivas sistu on Jan 20, 2009 4:05 PM

Former Member
0 Kudos

hi Srinivas,

You have given perfect solution.it working now. thank u very much..

thanks,

kishore.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can create 'LinkToURL' UI Elements in the view of your Web Dynpro application.

Kind Regards,

Nitin