Skip to Content
avatar image
Former Member

Get selected Tabstrip

Hello.

I have a TabStrip with two Tabs.

In my programm i must reset my view, and so the tabstrip is default.

how can i get the latest tab and set it after reset view?

thanks.

marcus

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Nov 19, 2008 at 10:37 AM

    Hi.

    How can i get a reference to the tabstrip on the view???

    Data: tab type ref to cl_wd_tabstrip,

    stab type string value 'TAB1'.

    tab->set_selected_tab( Exporting value = stab ).

    Add comment
    10|10000 characters needed characters exceeded

    • You can do something like this:

      METHOD wddomodifyview .
      
        DATA: l_tabstrip TYPE REF TO cl_wd_tabstrip.
      
        l_tabstrip ?= view->get_element( 'YOUR_TABSTRIP' ).
      ...
      

      But I must insist you should try the approach with a context attribute first instead.

      Regards

  • avatar image
    Former Member
    Nov 18, 2008 at 07:24 PM

    I could not understand your question properly, but if you want to get the Active tab and then make values as defualt then you can call

    GET_SELECTED_TAB method of class CL_WD_TABSTRIP to get the selected tab. It will return the name of the tab. And then you can proceed your coding for making them as default value.

    Hope it works.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 18, 2008 at 07:29 PM

    There's been a while since I last used tabstrips in WDA, but if I recall correctly, I did it getting a Tabstrip reference (CL_WD_TABSTRIP) in WDDOMODIFYVIEW, and then calling method SET_SELECTED_TAB with the name of the destination tab (type STRING).

    Nevertheless I think a better alternative would be to bind the selectedTab property to a context attribute and change that in the action handler, although I'm not sure if that works.

    Regards

    Add comment
    10|10000 characters needed characters exceeded