cancel
Showing results for 
Search instead for 
Did you mean: 

application parameter to be passed to view

Former Member
0 Kudos

Hi, in ECC6.0 I've created an application that has a parameter. This parameter is passed to a window which is unique to the application. The window has only 1 imbedded view. So now the problem. The window receives the parameter correctly from the application. However, the view does not receive the parameter from the window. I've tried creating plugs with parameters and linking them but this doesn't seem to work, the main reason being that no plugs are fired as there is only one view in the window. So how do I receive the parameter from the window into the view? I need to use the passed parameter in the WDDOINIT method of the view, so please don't suggest placing it in the context.

Thanks much,

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Okay... if you do not want to place it in context then use the component controller attribute to save the value from the window inbound plug.

wd_comp_controller->gv_prm_<name> = <importing variable>.

You can read this in the wddoinit of the view.

lv_<local_variable> = wd_comp_controller->gv_prm_<name>.

Former Member
0 Kudos

Hi Baskaran, this looks good, like exactly what I want but it still isn't working. I created a global public variable in the attribute tab of the component(i.e. gv_my_global_variable ). I set the global component variable in the HANDLEDEFAULT method of the window. I checked with a breakpoint and the parameter is being passed to the global component variable:

wd_comp_controller->gv_my_global_variable = my_parameter.

I then try to read this variable in the WDDOINIT method of the default view

lv_my_local_variable = wd_comp_controller->gv_my_global_variable.

However, checking with a breakpoint is showing the gv_my_global_variable as blank.

Any ideas?

Thanks,

Kevin

Former Member
0 Kudos

OK, I found the problem with this process. The WDDOINIT method of the view is being executed before the HANDLEDEFAULT of the window. Because there is only one view for this window there is only one plug(DEFAULT), which is generated automatically. When I open that plug I'm able to add other parameters, which I did in order to receive the parameter from the application. So where else can I load the global variable of the component if not from HANDLEDEFAULT method of the window?

Thanks again,

Kevin

saravanan_narayanan
Active Contributor
0 Kudos

Hello Kevin,

there are lot options available

option 1. you can create the parameter in Component Controller's member variable (as Baskaran mentioned) and access them in WDDOMODIFYVIEW of the view controller (by the checking the FIRST_TIME variable)

Option 2. if you want to perform some business logic based on the passed in parameter then you can create a method in component controller and call the same from HANDLEDEFAULT method of the window controller

option 3. you can create one OUTBOUND plug in Window Controller and one INBOUND plug in view controller and in the window controller you can create the navigation link between these two plugs. In the HANDLEDEFAULT method of the window controller, simply fire this OUTBOUND plug by passing the required parameters.

See webdynpro provides lots of options...I think this is the beauty of it.

BR, Saravanan

Former Member
0 Kudos

That is right, DoInit methods of window and views are executed first before the inbound plugs are executed. As suggested by saraa you can use the WDDOMODIFYVIEW , first_time boolean to check the first time and get the value from comp_controller.

However the value is there in comp_controller, you can directly use that where ever you need it. You do not have to assign to a local variable.

Former Member
0 Kudos

These are all good suggestions, however the main problem is still the same. How does the parameter go from the window to the component controller? This is my problem. Agreed that once it's in the component controller I can access it any number of ways, but I need to get it in the component controller before I call any views.

Your help is very appreciated.

Former Member
0 Kudos

Hi guys, so I read my variable in the WDDOMODIFYVIEW and it worked as you described. Thank you both very much. Your answers and explanations helped me understand this issue of parameter passing. I'm still confused as to the reason the WDDOINIT method of the view is called before the default plug from the window, but I'm sure it will eventually make sense.

Thanks a bunch and I'll try to reward points for both.

Kevin

Answers (0)