cancel
Showing results for 
Search instead for 
Did you mean: 

Using URL-Parameter in Views

Former Member
0 Kudos

I have a problem with using URL-Parameters in my Web Dynpro application. I've followed the steps in the thread , which work fine in general.

I have some views and a component controller, that executes some BAPIs. The result of the BAPIs are shown in the different views. In one of the views I put an input field for testing purposes, that is bound to the mapped value attribute holding the parameter. The parameter is used as an input parameter for the execution of the BAPI.

My problem is that the input field shows the correct value of the parameter, while the input for the BAPI is null all the time. I assume that at the time i want to call the BAPI the attribute value has not yet been mapped.

Does anybody know how this problem can be solved or implemented the right way? Thank you!

Andreas Adler

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Please move the BAPI call to the "Inbound Plug" action and read the URL parmeters before in the "Init" method of the view.

So first you can read URL parameters in the Init method and then it will go to the "Inboundplug" method.

Regards, VIP

Former Member
0 Kudos

Hi VIP

The Problem seems to be that at the time the init method of the controller is called the default-plug has not bound the url-parameters yes. On the other hand: at the time the default plug is called, the view (which is an initial view, so there's no inbound plug) seems to have run through completely. Basically all I have is a simple view and a default plug, which is in the interface view.

I hope I'm not completely missunderstanding the whole lifecycle mechanism and your advice... I'm still very happy for any tips to get it to work.

Regards

Andreas

Former Member
0 Kudos

However... I was able to solve the "problem" by getting the url-parameters by using:

WDWebContextAdapter.getWebContextAdapter().getRequestParameter(key)

Thanks everyone for trying to help me!

Andreas

Former Member
0 Kudos

We are experiencing the same problem.

It appears that the startup plug on the interface view has not been triggered when wdDoInit of the component controller runs making the URL parameter unavailable to the wdDoInit code. This seems like a bug to me.

Thanks for the work around, Andreas. "getRequestParameter" works like a charm. Wish I could give <i>you</i> points!

Former Member
0 Kudos

Hi ,

Instead of using value attribute why can't youe bind the InputField with the Modelattribute directly .

1.Create Model in ComponentController.

2.Create Model in view and do context mapping with component controller.

3. Bind the inputparameter to the InputField.

It should work.

Regards, VIP

Message was edited by: Anilkumar Vippagunta

Former Member
0 Kudos

Hi Vip

Thank you for your quick answer. I don't think this will solve the problem. The input field is just for visualizing the parameter values in the testing phase and won't be needed later on. The url-parameter will be needed as an input parameter for a bapi. The url-parameter can be null, therfore i wrote a routine how to handle that in the eventhandler of the component interface view. The BAPI gets the data according to the url-parameter, but at the time the BAPI is executed (in wdDoInit of the view) the eventhandler does not seem to have been executed.

Do you understand my problem? It's no that easy to explain though... Thank you for your help!

Regards

Andreas

Former Member
0 Kudos

Hi Andreas,

Then just make sure that your BAPI calling sequence starting from OnPlugDefault (or other startup-plug) of your application -- create <b>init(<i><params></i>)</b> method in Component Controller (or Custom Controller), place all BAPI logic here, use this controller from InterfaceView controller, and invoke this method from plug handler.

VS