cancel
Showing results for 
Search instead for 
Did you mean: 

How to open new browser window by using webdynpro JAVA

Former Member
0 Kudos

Hi friends,

How to open new browser window by using webdynpro JAVA.?

My Requirement is, when I click on “LinkToAction” UI element in Table. That output is display the another browser window.

I create method in “LinkToAction”.

int i = wdContext.nodeSrcResultNode().getLeadSelection();  

            

String resName = wdContext.nodeSrcResultNode().currentSrcResultNodeElement().getResName();

Output for    resName:xyz & trainings.html

                       

String resURL = wdContext.nodeSrcResultNode().currentSrcResultNodeElement().getResURL();

 

Output for   resURL =documents/xyz/Folder View/Knowledge Content/blogs/2010/06/xyz & trainings/ xyz & trainings.html

            

String portalDevURL = "http://hostname:50500/irj/go/km/docs";

String combineURL=portalDevURL + resURL;

           

wdComponentAPI.getMessageManager().reportSuccess("combineURL:-"+combineURL);

combineURL: http://hostname:50500/irj/go/km/docs/documents/xyz/Folder View/Knowledge Content/blogs/2010/06/xyz & trainings/ xyz & trainings.html

When I open this output URL in Browser its working fine.

For Open the new browser window I wrote this line code:-

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(combineURL,"Window title",false);

window.open();

I got this error:

com.sap.tc.webdynpro.services.exceptions.InvalidUrlRuntimeException: Invalid URL=http://hostname:50500/irj/go/km/docs/documents/xyz/Folder View/Knowledge Content/blogs/2010/06/xyz & trainings/ xyz & trainings.html.

How to solve this problem?

Accepted Solutions (1)

Accepted Solutions (1)

vijay_kumar49
Active Contributor
0 Kudos

Please try this

Output for   resURL =documents/xyz/Folder View/Knowledge Content/blogs/2010/06/xyz & trainings/ xyz & trainings.html

Here some spaces is avaliable. i thought bcz of that its not working. please try below code. hope its use full

 

String finalUrl = resURL.replaceAll(" ","%20");

String portalDevURL = "http://hostname:50500/irj/go/km/docs";

String combineURL=portalDevURL + finalUrl;

IWDWindow window = wdComponentAPI.getWindowManager().createExternalWindow(combineURL,"Window title",false);

window.open();

hope this is help full

Regards

Vijay kalluri

Former Member
0 Kudos

Solved

thaknsk Vijay

Answers (2)

Answers (2)

junwu
Active Contributor
0 Kudos

Add this line of code before creating window

combineURL=URLEncoder.encode(combineURL,"UTF8");

former_member182374
Active Contributor
0 Kudos

Hi,

Try to replace the & with %26 (or better yet encode the url to UTF-8 before trying to open it with Web Dynpro).

Regards,

Omri

Former Member
0 Kudos

Hi,

I think this issue is for the images in .html file.At first remove the image for the time being and check the code is working fine or not.

If yes then try to fix the issue by checking following points.

1)Image property is correct or not?

2)Try to create one valid URL - use java.net.URLEncoder.encode()


Thanks,

Patralekha Sur