cancel
Showing results for 
Search instead for 
Did you mean: 

Pass URL parameters to JWD using POST.

Former Member
0 Kudos

Hello,

I am calling a JWD application from a html using POST. The html is stored in KM (web page composer)


<form method="POST" action="http://<host>.com:50100/irj/portal?NavigationTarget=<PCD location of target iview>" id="<name>">

How should I pass the html form input values (text input value and drop down value) from the POST method to the java web dynpro application ?

Thanks

Tony

Accepted Solutions (1)

Accepted Solutions (1)

former_member197348
Active Contributor
0 Kudos

Hi Tony,

Try to pass parameters like this:

<form method="POST" action="http://<host>.com:50100/irj/portal?NavigationTarget=
<ROLES://<path_to_iview>&DynamicParameter=param1%3Dvalue1%26param2%3Dvalue2>u201D  id="<name>">

You can catch the parameters in Web Dynpro like this:

IWDProtocolAdapter protocolAdapter = WDProtocolAdapter.getProtocolAdapter();
IWDRequest request = protocolAdapter.getRequestObject();
String RESPONSIBLE_NO = request.getParameter("param1");

\

Regards,

Siva

Former Member
0 Kudos

Hi Siva,

Thanks a lot for your reply.

The parameters are dynamic(according to the user's input/selection). How should I capture their value in the run time. There are 2 such values , a text input value and a dropdown value.

Is javascript an option in my case?

The problem is how to send these dynamic parameters

In your code


&DynamicParameter=param1%3Dvalue1%26param2%3Dvalue2 

I don't know value1 and value2, they are runtime values.

Should I use javascript to get value1 and value2 ???

Edited by: Tony on Mar 5, 2009 7:28 AM

sanyev
Active Participant
0 Kudos

Hi Tony,

I have answered your other post. Below is the contents of that post.

request.getParameter("searchText");

The above code is capable of retrieving http POST parameters also. You don't have to do anything extra. If the target of your html form is your webdynpro application the form parameters will be available to your WD application.

Two property should be set in your Webdynpro IView (This is mandatory and without which parameter will not be passed)

1. "Isolation Method" to URL

2. "Parameters to Pass from Page Request (for URL Isolation)" should be set to value *

That means all the parameters will be passed to the Webdynpro applicaiton.

Try this. Get the preview URL for your Webdynpro IView. append &searchText=test to the end of the URL and launch the application. You can right click on the Webdynpro IView and click preview to open the preview window. get the URL from the window.

The URl would look something like this.

http://winxp:50000/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fsanyev!2fParameter?sap-conf...

Once you are able to pass the parameter you can try with the post parameters. i have test this and it works. Make sure the two properties mentioned above are set in your iview properties.

Regards,

Sanyev

former_member197348
Active Contributor
0 Kudos

Hi Tony,

Yes, you need to java script to capture input value and dropdown value. Then you need to pass them to the URL in this form

&DynamicParameter=param1%3Dvalue1%26param2%3Dvalue2

where param1 is the name of the parameter and value1 is its value.

This param1 parameter(this is same everytime) can be captured in your web dynrpo and value1 (this is dynamic) can be retrieved using param1

Regards,

Siva

Former Member
0 Kudos

I am able to send parameters to JWD. Now the JWD iview is opening in a new page within the body of existing page. Now I have 2 mastheads, 2 pageheader links.

I set the property of iview "isolation method" to URL and also Pass parameters (URL Isolation) to *

Still no effect.

Thanks

Edited by: Tony on Mar 5, 2009 6:53 PM

sanyev
Active Participant
0 Kudos

Hi Tony,

Get the preview URL and append the parameters at the end of the preview URL like you did for the JWD application. Get it to work first. To get the preview URL navigate in content administrator to your Webdynpro iView and right click and click on preview. A new window will be launched. The URL with which the new window is launched is the preview URL.

Webdynpro is desiged to receive any request parameter but when a Webdynpro application is embedded in an iView parameters are not passed inside the iveiw. For that you need to set the parameters isolation Method t URL and pass parameters from page request to *. Once these parameters are done your iView will be capable of passing request parameters.

After setting the parameter you need to test if this is working by appending the parameters at the end of the preview URL. This will make sure that the parameters are set properly. Once its starts working in the preview URL you can use the same preview URL as you html target.

If you use form method="GET" all the form parameters will get automatically appended to your URL. No need to use javascript for that. Your Webdynpro application is capable of reading POST parameters also so no need to change the form method to GET. POST will work just fine.

If you use the preview URL you will not get two portal masterhead. Make sure you identify the exact Webdynpro iView from the pcd. It has to be the webdynpro iView itself not any page which contains the webdynpro iview.

I have done similar requirement before. I will work properly. Keep trying.

Regards,

Sanyev

Former Member
0 Kudos

Hi Siva,

Can we post html parameter for reading and writing in the same webdynpro application ? If yes please let me know how can we do that ?

Thanks,

Vinit

Answers (2)

Answers (2)

former_member185086
Active Contributor
0 Kudos

Hi

1. url parameter Post

BR

Satish Kumar

Edited by: satish jhariya on Mar 5, 2009 11:26 AM

former_member185086
Active Contributor
0 Kudos

Hi

Check the following threads for input

1.[url parameters|;

2.[url Paramter of Page for a WebDynpro iView|/message/2124984#2124984 [original link is broken];

3.[Request parameters in http post|;

4.[How Webdynpro accepts & processes POST request from other application|;

BR

Satish Kumar