on 01-26-2006 10:33 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.