on 01-02-2014 6:22 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add this line of code before creating window
combineURL=URLEncoder.encode(combineURL,"UTF8");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.