cancel
Showing results for 
Search instead for 
Did you mean: 

button visibility in different views

Former Member
0 Kudos

hi experts,

Iam having a view say (V1). in V1 i do have 2 buttons in invisible mode. Iam using that V1 in V2 (in viewuielement container). in v2 i need to make those 2 buttons visible. please guide me in this.

Regards,

murthy.

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi,

Create an atribute of wdui_visibility type and bind it with the visible property of the buttons. Now in the WDDOINITuse this code:


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

  DATA lr_rr_view_usage TYPE REF TO if_wd_rr_view_usage.

  lr_rr_view_usage = lo_api_v_completed->get_view_usage( ).

  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( ). "this will give you the active view name

if lv_name eq 'V2'.
" make the buttons visible by setting the attribute 02 with the help of code wizard.
else
" make the buttons invisible by setting the attribute 01 with the help of code wizard.
endif.

use this code in WDDOINIT method of both the views.

I hope it helps.

Regards

Arjun

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Make the attribute of type WDUI_VISIBILITY in component controllerand map that attribute in both of ur view.Bind the button

visibility property with that attribute. Now based on ur condtion with which u are going to ur view V2, say on click of a button then set

the value of the attribute to 02, for visible.

Regards,

Pankaj Aggarwal.