cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Web Dynpro iView pcd url from Web Dynpro application?

Former Member
0 Kudos

Hi, SDN Fellows.

I am doing a relative navigation from one Web Dynpro iView to another Web Dynpro iView, the code as following:


String [] path = {"workset1","pageB"};
String baseurl = "ROLES://portal_content/folder1/folder2/worktset1/pageA";
	WDPortalNavigation.navigateRelative(baseurl,2,path,"",WDPortalNavigationMode.SHOW_INPLACE,(String)"",(String)"",WDPortalNavigationHistoryMode.ALLOW_DUPLICATIONS,"MyPageA","","MyParameter=paraA");

My problem is at the baseurl, as I don't want to hard code the baseurl path at the Web Dynpro application, as these two pages can be assigned to different roles.

So, what I want to do is to write a line of code to get the current Web Dynpro iview pcd url, say: "pcd:portal_content/folder1/folder2/worktset1/pageA", then replace the "pcd:" to "ROLES://" to form the right iview role url parameter.

I can do this every easily with the EPCF framework if using JSPDynpage (but now Web Dynpro does not support Java Script), as following:


parent.pageSupport.getIvuId(self);

I believe I can achieve the same thing with the Page Builder API or something like PCD Service in Web Dynpro too.

Can anyone advise me how to achieve this?

Thanks.

Kent

Accepted Solutions (1)

Accepted Solutions (1)

former_member182374
Active Contributor
0 Kudos

Hi Kent,

Add the following parameter to your Web Dynpro iview (Under 'Application parameters'):

iViewPath=<IView.ID>

Add the following code:

iViewPath = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("iViewPath");

Now, iViewPath will contain 'pcd://portal_content....'

Regards,

Omri

Former Member
0 Kudos

Hi, Omri.

I have looked at this method, it is an alternative to solve my current problem. But there is some inflexibility since I have to manually add the parameter of the IvIew path. Meaning, eveytimes the Sytem Administer change the name, he has to go to edit the parameter of iView path.

My ideal solution (if exist) is to programmatically getting the iView path (like I described using the EPCF framework).

But I will implement your suggestion for the time being. Hope that I can have the solution that I desired later.

Thanks a lot.

Kent

former_member182374
Active Contributor
0 Kudos

Hi Kent,

I think you misunderstood (-:

<IView.ID> is a "built in" parameter in the portal, meaning, this is exactly what you need to write in the application parameter (you don't write the path itself - hard coded).

Say you have 2 Web Dynpro iviews:

1) portal content/my role/wd1

2) portal content/my role/my workspace/wd2

Both iviews have the SAME parameter iViewPath=<IView.ID>

The parameter is dynamic so you'll get the CORRECT path each time.

The administrator needs to make sure that the parameter is exist, he doesn't need to change it!

Regards,

Omri

Former Member
0 Kudos

Omri,

I have done the exact same thing, but it is giving me an null value for the iViewPath.

I have added this string:

iViewPath=<IView.ID>

in the Parameters to Pass from the Page Request (for URL Isolation) property of Web Dynpro iView.

And in my Web Dynpro apllication, I put this code in my init() method:

iViewPath= WDWebContextAdapter.getWebContextAdapter().getRequestParameter("iViewPath"); 

Please advise.

Kent

former_member182374
Active Contributor
0 Kudos

Hi Kent,

The code was tested on NW04 SP16/17/19 and should work on other versions as well...

The only thing I can think of is capital letters:

the value should be <IView.ID> (Capital i, v, and then id).

Regards,

Omri

Answers (4)

Answers (4)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Kent,

The best way to do navigation is definitely to use object based navigation. I would recommend that you follow this approach because you wont need to hard code the PCD path in your code. This is definitely the way to go. With OBN you create objects like Order and Order Detail, and you navigate to those. You use the administrator to set the relationship between these objects and the actual pages etc on which they are shown. A much more maintainable approach

Former Member
0 Kudos

John, let me have a look on the OBN.

Thanks for your suggestion and will get back to you.

Kent

Former Member
0 Kudos

Hi Kent,

Find the url's which can help u.

<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/44/6aaf92f5a23672e10000000a114a6b/content.htm">http://help.sap.com/saphelp_nw04s/helpdata/en/44/6aaf92f5a23672e10000000a114a6b/content.htm</a>

<a href="https://help.sap.com/javadocs/NW04S/SPS09/pc/com/sapportals/portal/pcd/gl/doc-files/ProgrammingExamples.html">https://help.sap.com/javadocs/NW04S/SPS09/pc/com/sapportals/portal/pcd/gl/doc-files/ProgrammingExamples.html</a>

regards

Sumit

Former Member
0 Kudos
Former Member
0 Kudos

Suresh and Summit, I cannot find any relevancy for the links that you have sent to me with the question that I am asking.

Can you point to me more specifically how can I get the pcd url of an Web Dynpro Iview from the programming inside the Web DYnpro application?

Thanks.

Kent