cancel
Showing results for 
Search instead for 
Did you mean: 

Url parameters in componentcontroller

Former Member
0 Kudos

Hello,

as I notice, url parameters we are collecting in windows HANDLEDEFAULT event handler. But program just at the startup reach this place.

So I want to ask, how I can collect url parameters in COMPONENTCONTROLLER at least in VIEW. Or from these component I can call WINDOWS HANDLEDEFAULT method.

Thank you for replays.

Accepted Solutions (1)

Accepted Solutions (1)

chengalarayulu
Active Contributor
0 Kudos

Martynas,

you can perform in two ways.

1. By defining attributes at component controller level.

     Just define required attributes of your application parameters type at component controller level, and assign the values at HANDLEDEFAULT of your window.

     thereafter you can make use of throughout your component.

2. By defining attributes at Assistance Class level.

     same as above. but attributes should be at AssistanceClass level.

Former Member
0 Kudos

Chengalarayulu D,

At the moment I am getting these parameters in t HANDLEDEFAULT of my window and assign to assistant class.

But web Dynpro is working in this way:

1. ComponentController INI,

2. View INI,

3. Windows INI

So parameters I am getting just et the end, but these parameters I need in ComponentController.

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

It will be executed in the order you mentioned. But if you need it in component contoller's method other than WDDOINIT, just check whether that method is accessed after Handle Default of Windows. You can put a breakpoint in that method and Handle default of Windows to check the precedence.

chengalarayulu
Active Contributor
0 Kudos

Hi,

however, HANDLEDEFAULT also will execute before screen visible, so, if you wanna do any operations with those parameters.. follow the below..

of course, as you mentioned execution sequence is right. if you see the below you can get some more idea.

1. Create a method at Component controller level i.e. AFTER_HANDLEDEFAULT which can make use of application parameters.

     if  wd_this->param1 eq 'PARAM1'.

      ELSE.

      ENDIF.

2. in HANDLEDEFAULT  of window

          **** get the parameters, and assign those to global attributes which are created at component controller level / assistance class level *****

     wd_comp_controller->param1 = <application level parameter>.

          now call the method of comp-controller

               wd_comp_controller->AFTER_HANDLEDEFAULT( ).

3. Now your parameters are available globally, and required operations also executed on demand.

4. test the applicaiton.

hope you understood.

Former Member
0 Kudos

Hello Chengalarayulu D,

thank you for solution suggestion. It is working perfectly!

Answers (1)

Answers (1)

Former Member
0 Kudos

You can create an Assistance class and add attributes in it and can save the parameter values in those Assistance class attributes and they will be available all over the component globally through out its life.

Thanks

Phani