cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic tab apperence in tabstrip in webdynpro

mahesh_jagnani
Participant
0 Kudos

Hi Experts,

Is it possible that based on customizing table data , the tab position will be controlled in tab strip.

Ex:- If there are 4 tabs (TAB1,TAB2,TAB3,TAB4) in tab strip then depending on the value coming from table , either the position of tab will be like (TAB1,TAB4,TAB3,TAB2) or (TAB2,TAB3,TAB1,TAB4) or....any possible set coming from customizing table.

Please help.

Thanks

Mahesh

Accepted Solutions (0)

Answers (4)

Answers (4)

mahesh_jagnani
Participant
0 Kudos

solved

Former Member
0 Kudos

Hi,

We have selected tab property for tabstrip, set this property dynamically based on your condition.

You can get the reference in DOMODIFYVIEW method of view containing the tabstrip UI element .

try the following code

data: lo_tabstrip type ref to cl_wd_tabstrip.

lo_tabstrip ?= view->get_element( 'TABSTRIP_ID' ). "replace by tab strip id

now you have the reference and you can call set_selected_Tab method

lo_tabstrip->set_selected_Tab( 'SELECTED_TAB_ID ).

Cheers,

Kris.

Former Member
0 Kudos

see the class CL_WD_TABSTRIP, i remember seeing that you can add tabs method having index parameter.

You can get the instance of the tabstrip, get the tabs and add them according to your requirement using index.

Abhinav_Sharma
Contributor
0 Kudos

hi Mahesh,

I guess you can not change the positions of the tab once it is defined initially. This is something not allowed at runtime. But what is allowed is to create TabStrip at design time and then Add required Tabs dynamically based on your logic.

You can get the reference of TabStrip like below

lo_tabstrip ?= view->get_element( id = 'TBS_TAB' ).

And then you can create and add Tabs like below

lo_caption = cl_wd_caption=>new_caption( id = 'CAP3' ).

lo_caption->set_text( value = 'Tab3' ).

llo_tab = cl_wd_tab=>new_tab( id = 'TAB3' ).

lo_tab->set_header( the_header = lo_caption ).

lo_tabstrip->add_tab( the_tab = lo_tab ).

This way you can achieve what you want. Hope this helps.

Regards

Abhinav