cancel
Showing results for 
Search instead for 
Did you mean: 

How to connect to a html using webdynpro

Former Member
0 Kudos

Hai,

In my webdynpro application , I need a control when i click on the control i need to connect to a html file.

whch control is better linktourl OR linktoaction.

when i click on this link i need to open the html file in another window.

please help me.

regards,

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Naga,

If your resource is static and located in component "mimes" folder or this is just a pointer to external web site, then it is better and simpler to use IWDLinkToUrl directly.

If this is a reference to externally hosted document, then just set "reference" attribute directly. If this is HTML file in "mimes" folder, then bind this link "reference" to context attribute, say Url, and write something like this in wdDoInit of view controller:


try
{
  wdContext.currentContextElement().setUrl
  (
    WDURLGenerator.getAbsoluteWebResourceURL
    ( 
      wdComponentAPI.getDeployableObjectPart(),
      "my-file.html"
    );
  );
}
catch (final WDURLException ex)
{
  wdComponentAPI.getMessageManager().reportException
  (
    new WDNonFatalException(ex), false
  );
}

In both cases set "target" of IWDLinkToUrl to "_BLANK"

Use code from my blog only if you have to display HTML content from some dynamic source (database, RFC call result, dynamically created by application etc.)

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hai valery,

Thanks for your help.

I got it.

regards,

naga raju

Former Member
0 Kudos

Hi Valery,

I am running EP6 SP14.

The syntax

WDURLGenerator.getAbsoluteWebResourceURL

(wdComponentAPI.getDeployableObjectPart(),

"my-file.html");

is showing up as deprecated.

Is there an improved way of doing this?

Kevin

Former Member
0 Kudos

Figured out myself...

WDURLGenerator.getWebResourceURL(wdComponentAPI.getDeployableObjectPart(),

"my-file.html") is not deprecated.

Regards,

Kevin

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hi Naga,

Check Valery`s nice blog /people/valery.silaev/blog/2005/11/23/display-formatted-text-using-webdynpro-for-java describing similar issue.

Best regards, Maksim Rashchynksi.