cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: Onclick events in tabstrip

Former Member
0 Kudos

Hi experts,

I have created an application with a view whcih has tabstrip. This holds the other views embedded in it for each tab.

Inside the each views, there are buttons to allow naviagiton for before the current tab and as well as to the next tab.

On click of this button, how should the code be incorporated as we cannto use inbound / outbound plugs for this case.

Please help on this.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Inside, each tab you have views embeded of same compoenent right inaddtion to buttons.

My question is, are these butons inside each TAB or inside the view.

How are they designed.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

thanks for response.

Inside each tab, views are embedded.

Each view contains buttons to navigate to tabs.

Former Member
0 Kudos

Hi,

I think, you have other views embedbed in other TABS.CReate a attribute for TAB selection and bind it to the SELECTEDTAB

When you are in first TAB, upon those buttons handler,

You can set the attribute to 2nd TAB.

As I have achieved the same.

Hope this is clear. Then you dont require any plugs right.

***Set the selected tab value

CALL METHOD WD_CONTEXT->SET_ATTRIBUTE

EXPORTING

VALUE = lv_select_tab

NAME = 'SELECT_TAB'. "Set the selected tab Id

Im able to switch bewteen tabs of a tabstrip.

Regards,

Lekha.

Edited by: Lekha on Oct 16, 2009 3:11 PM

Former Member
0 Kudos

Hi Lekha,

Thanks for ur valuable inputs in right time...

This does not require plugs. I declared a global attribute of type string in component controller.

Later, binded this attribute to the tabstrip's selected tab property.

Then as you said on click method of button, i wrote the code and its working fine..

Thanks a lot..

Answers (1)

Answers (1)

Former Member
0 Kudos

Using the set_selected_tab method you can navigate to the tabstrip. Follow these steps; 1) Fetch the reference of your tabstrip by passing its ID within your WDDOMODIFYVIEW 2) Save the reference obtained in a view level attribute 3) Now within your action handler method just use this reference to set the desired tab as selected

METHOD WDDOMODIFYVIEW .
  check first_time = abap_true.
" Fetching the reference of the tabstrip. My tabstrip id is TABSTRIP
    wd_this->gv_tabstrip ?= view->get_element( id = 'TABSTRIP' ).
ENDMETHOD.

METHOD ONACTIONOK . " event for your button action
" Use the earlier obtained reference to set the first tab as selected
" My first tab's id is TAB1
  wd_this->gv_tabstrip->set_selected_tab( value = 'TAB1' ).
ENDMETHOD.
Thanks, Radhika