cancel
Showing results for 
Search instead for 
Did you mean: 

Tabstrip: navigate with buttons instead of tabs

Former Member
0 Kudos

Hi,

I have a tabstrip with several tabs. To go from one tab to another I could click the tab. But I need to have another option as well, with buttons. On each tab I have buttons ("Next" and "previous"). What do I need to do so that when the user clicks the button they are taken to the next tab? I'm still new to Webdynpros I know I need to create an action for my button, but I don't know how to code the method for my action so that I will end up on the next tab.

Thanks, Ira

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Lets assume your tabs are named as Tab1, Tab2, Tab3..etc and your tabstrip is called MyTabStrip

Create a context attribute of type string , lets call it Tab.

In the wdDoModifyView, write the following code:


    IWDTabStrip tabElement = (IWDTabStrip) view.getElement("MyTabStrip");
    tabElement.setSelectedTab(wdContext.currentContextElement().getTab());

This should be the code for your button Action:

For Tab1 - method onActionTab1


  public void onActionTab1(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionTab1(ServerEvent)
    wdContext.currentContextElement().setTab("Tab1");
    //@@end
  }

Regards,

Subramanian V.

Former Member
0 Kudos

Hi Subramanian,

Sorry, I guess I forgot to say I'm doing WebDynpro for ABAP. I sort of understand your answer but could you maybe translate it to ABAP?

Thanks, Ira

Former Member
0 Kudos

I am sorry, I can't write Web Dynpro for ABAP Code, but I can give an idea what needs to be done :

a) Let the name of tabstrip be MyTabStrip

b) Let the name of tabs be Tab1, Tab2

c) Create a context attribute of type string called TAB

c) In the method wdDoModifyView , you need to get the reference of the element "MyTabStrip"

d) Change the selectedTab attribute of this Tabstrip to Tab1 or Tab2 depending upon which button the user has clicked

User clicks Tab1

=================

When user clicks Tab1, set the value of context attribute TAB to Tab1

User clicks Tab2

=================

When user clicks Tab2, set the value of context attribute TAB to Tab2

Regards,

Subramanian V.

Answers (2)

Answers (2)

Former Member
0 Kudos

Don't use a TabStrip for visualizing a sequential process. Use a RoadMap or PhaseIndicator instead.

Armin

Former Member
0 Kudos

Hi

See this Samples and Tutorials

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b1a3e990-0201-0010-aeb2-a2ef5bc3da8e">creating an Extended Web Dynpro Application</a>

Kind Regards

Mukesh