cancel
Showing results for 
Search instead for 
Did you mean: 

Passing EP iview's value to WD iView

Former Member
0 Kudos

Hello all,

I have an EP iView where the user is entering a few parameters.

When pressing a button I need to display the chosen values on a WD iView.

I'm firing an event from the EP to the WD and it's working fine.

the problem is that I only know how to get 1 parameter when subscribing to an event in WD. does anyone knows how to get more then 1?

I tried storing the parameters in the session (in the EP)

and get them in the WD but it is not working.

The code in the EP:

IPortalComponentRequest request = (IPortalComponentRequest)this.getRequest();

IPortalComponentSession mySesh = request.getComponentSession();

HttpSession myHTTP = mySesh.getHttpSession();

myHTTP.setAttribute("a","a");

The WD code:

HttpServletRequest request = ((IWebContextAdapter)WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

HttpSession session = request.getSession();

String a= (String)session.getAttribute("a");

but I'm getting null.

any solution?

Thanks, Adi.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Adi,

You can send multiple values to your WD through client data bag. Do something like this.

In your iview:

u can use EPCM.storeClientData() to store a value into the data bag.

For ex:

EPCM.storeClientData("urn:com.sapportals.portal.search","searchField",field);

Then in your WD:

Retrieve them as follows:

(Remember to url encode the urn string (as for de_shn in the code below)

Cookie[] cookies = TaskBinder.getCurrentTask().getWebContextAdapter().getHttpServletRequest().getCookies();

for (int i = 0; i < cookies.length; i++) {

if (cookies<i>.getName().equals("SAPPORTALSDB0")) {

value = cookies<i>.getValue();

String de_shn = "urn%253Acom.sapportals.portal.search%2526searchHelp%3D";

String de_fld = "%3B%20urn%253Acom.sapportals.portal.search%2526searchField%3D";

String shn = value.substring(de_shn.length() , value.indexOf(de_fld));

String fld = value.substring(value.indexOf(de_fld) + de_fld.length(), value.length());

ret = true;

break;

}

}

Thanks,

Rajit

Former Member
0 Kudos

Hi Adi,

I too faced the same problem while navigating from PDK based iView to WD iView.

What we have done is:

Pass a single parameter as a string. In that string you can have different names and values parameters seperated by a delimiter(";").

Something likethis

DynamicParameter=name1=value1;name2=value2;name3=-value3;

In the WD iView, read the DynamicParameter. I guess you were able to do this.

If you read that you will be able to get

"name1=value1;name2=value2;name3=-value3;"

Then take a string tokenizer and break it into tokens based on the delimiter and read the different values.

We had followed the same approach as described above.

Hoping that this helps

Thanks and regads

RK

Former Member
0 Kudos

Hi,

Either you can use String method suggested by Radha.

But i think you can collections as well here!

Try to store all your values in Vector and pass this object to your Web Dynpro view.