cancel
Showing results for 
Search instead for 
Did you mean: 

Please look at this code and provide me some reply.

Former Member
0 Kudos

Hi,

please look at this declaration of String variable:

String idParam = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("ID");

Class WDWebContextAdapter

java.lang.Object

|

+--com.sap.tc.webdynpro.services.sal.adapter.api.WDWebContextAdapter

-


public class WDWebContextAdapter

extends java.lang.Object

This class allows the access to the origin request. If Web Dynpro is used within the SAP Portal Runtime, the Web Dynpro application developer may use Portal services. For that, the origin request object is often needed to use a lot of the existing Portal services. In the Portal case, the origin request would be a IPortalComponentRequest object.

getWebContextAdapter:

public static IWDWebContextAdapter getWebContextAdapter()WebContextAdapter abstracts from any protocol and plattform dependent contexts, this method returns the adapter for the actual request

Returns:

the adapter for the actual request

getRequestParameter:

public java.lang.String getRequestParameter(java.lang.String key)Method getRequestParameter. returns the parameter value for the specified key

Parameters:

key -

Returns:

String

Now, this String key: "ID" gets the value from the portal runtime url or what?

Can anybody please explain in detail?

Regards

Neha Singh

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi,

This docs looks fruitful.

I will complete the doc.

Regards

Kaushik Banerjee

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Kudos

Hi,

If you running your Web Dynpro as standalone then your url will look like this:

http://<server>:<port>/webdynpro/disptacher/local/<prj name>/<app name>?ID=12345

This is simple query string

If you running your Web Dynpro as portal iview then the 'application parameters' property will contain ID=123 (the application integrator will calculate the correct url - encoding etc...)

Regards,

Omri

Former Member
0 Kudos

Hi Omri,

You are right.

Now check this part of the code.

public void wdDoInit()
  {
    //@@begin wdDoInit()
	msgMgr = wdComponentAPI.getMessageManager();
	String idParam = WDWebContextAdapter.getWebContextAdapter().getRequestParameter("ID");
	String tmpUrl2 =  null;
	if(idParam!=null)
	{
//	   something like : "2:1;" or "2:1;2;" or "3:1;2;3;" or "2:2;3;"
	String tmpString1[]=idParam.split(":");
	String tmpString2[] = tmpString1[1].split(";");
	String id= tmpString2[0]; // is always the first one
	String tmpUrl = this.getConfigItem("Url");
	
	String user = this.getConfigItem("User");
	
	String password = this.getConfigItem("Password");
	
	String uRLSuffix = this.getConfigItem("UrlSuffix");
	tmpUrl2 = tmpUrl+id+"&j_user="+user+"&j_password="+password+uRLSuffix;
	
	wdContext.currentContextElement().setUrl(tmpUrl2);
	}
	wdComponentAPI.getMessageManager().reportSuccess("URL to load: " + tmpUrl2);
    //@@end
  }

Here, "Url", "User", "Password" and "UrlSuffix" are getting values from default.properties.

But when I am writting this line

wdComponentAPI.getMessageManager().reportSuccess("URL to load: " + tmpUrl2);

I am getting the output as the portal iView but the IFrame is not populating any data in the View.

Even if the IFrame source is connected with the View Context and that is linked with Component Controller.

Regards

Neha Singh