cancel
Showing results for 
Search instead for 
Did you mean: 

How to get name/id of currently shown view of a window

Former Member
0 Kudos

Hi all!

I have implemented a Web Dynpro Component with one "Component Controller", one Window and two Views which are embedded in the Window (but not shown in parallel).

Within the method WDDOBEFORENAVIGATION I would like to do some validation-checks but therefor I need to know which view is currently shown! Is there a way to determine this information.

I would prefer a solution where I don't have to store any information everytime a view is called. Is it possible to get a reference to the window-controller and to get the information about the currently shown view? I would store this reference in the component-controller and could then grab the necessary information (if possible ).

Thanks for your answers in advance,

Stefan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Stefan,

You can use the IF_WD_VIEW of WDDOMODIFYVIEW get the view usage name and store them globally.

OR

DATA lo_api_v_completed TYPE REF TO if_wd_view_controller.
    lo_api_v_completed = wd_this->wd_get_api( ).

lr_rr_view_usage type ref to IF_WD_RR_VIEW_USAGE.
 
  lr_rr_view_usage = lo_api_v_completed ->GET_VIEW_USAGE( ).
Use the methods:
DATA: lr_rr_view type ref to IF_WD_RR_VIEW,
          lv_name type string.
  lr_rr_view = lr_rr_view_usage->GET_VIEW( ).
  lv_name = lr_rr_view->GET_NAME( ).

Also check IF_WD_VIEW_CONTROLLER~GET_CURRENT_ACTION_INFO that returns WDAPI_ACTION which has the view name as a attribute.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

unfortunately this also does not give me the right View-information! I have solved it now an other way: I grab the information (the name of the active view) in the view and store it to a context-attribute!

That's not nice but it works for me - unfortunately I cannot waste more time with this!

Thanks to all & best regards,

Stefan

former_member402443
Contributor
0 Kudos

Hi Stefen,

Please check these interfaces -

1.IF_WD_RR_VIEW

2.IF_WD_RR_VIEW_USAGE

Hopes this will helps you.

Regard

Manoj Kumar

Former Member
0 Kudos

Hi Manoj,

unfortunately I don't know how to get the real embedded view! When I try to get the View-Usage(s) I always get information about the window! I tried to do it as shown in the following example:

DATA lo_api_wi_customer_view TYPE REF TO if_wd_window_controller.
  lo_api_wi_customer_view ?= wd_this->wd_get_api( ).

  DATA: lo_view_us TYPE REF TO if_wd_rr_view_usage.
  lo_view_us = lo_api_wi_customer_view->if_wd_view_controller~get_view_usage( ).

I debugged into the if_wd_window_controller but could not find a way to determine the currently embedded view(s).

@Bala: The interface would be ok but it's only accessible in wddomodifyview...

Best regards,

Stefan

Former Member
0 Kudos

Stefan,

check this interface IF_WD_VIEW it may be useful

Thanks

Bala Duvvuri