cancel
Showing results for 
Search instead for 
Did you mean: 

tabstrip

Former Member
0 Kudos

Hi,

When i press a button it should go to next tab of that tab strip which contain two tabs in that.

How this can be done in web dynpro java?

Regards,

H.V.Swathi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Add an attribute called selectedTab to the view context and bind it to the selectedTab property of the TabStrip UI Element.

In that Event Handler method set the selected tab value to the id property of the second selected tab.

i.e. in the Event Handler method

wdContext.current...Element().setSelectedTab(x);

where x is the Tab Id for the second tab.

Regards,

Gayathri.

Former Member
0 Kudos

Hi,

I also trying to model application as described at the topic.

As suggested, added an attribute selecTab to the view context and bind it to the selectedTab property of the TabStrip UI Element.

When I try to write this line in my Event Handler (onActionGoto):

wdContext.currentContextElement().setSelectedTab("Tab1");

eclipse gives me an error an I need to cast this line to:

((IWDTabStrip) wdContext.currentContextElement()).setSelectedTab("Tab1");

Then, when I run an application, after I press a button in order to go to to Tab1 it crushes with exception:

The initial exception that
caused the request to fail, was:

java.lang.ClassCastException: class
com.sap.demo.costrevenuesexample.wd.comp.new2comp.wdp.IPrivateTransitionsCompView$IContextElement:demo.sap.com/costrevenuesexample@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@54517374@alive
incompatible with interface
com.sap.tc.webdynpro.clientserver.uielib.standard.api.IWDTabStrip:service:tc~wd~webdynpro@com.sap.engine.boot.loader.ResourceMultiParentClassLoader@1e52e26f@alive

How to handle this error,

Thanks

Answers (2)

Answers (2)

Former Member
0 Kudos

Seems you are using a TabStrip for visualizing a sequential process. I would recommend against doing that and use a RoadMap or PhaseIndicator instead. A TabStrip by definition allows random-access to its tabs and should not be used in another way.

The tabstrip selection can be controlled by binding the "selectedTab" property to a context attribute and by setting the attribute value to the ID of the tab that should be selected.

Armin

Former Member
0 Kudos

hi ...

Take a attribute (selectTab ) of type String in the context structure.

Bind this attribute to the selectedTab property of your Tab strip.

for example let the id of your 2 tabs are Tab1 and Tab2

Initially in wdInit() method you set the seleectedTab to Tab1(its your choice either 1 or 2) as

wdcontext.currentContextElement().setSelectedTab("Tab1");

In the onAction() method of your button you

Keep the following code

String s=wdcontext.currentContextElement().getSelectedTab();

if(s.equalsIgnoreCase("Tab1"))

{

wdcontext.currentContextElement().setSelectedTab("Tab2");

}else if(s.equalsIgnoreCase("Tab2"))

{

wdcontext.currentContextElement().setSelectedTab("Tab1");

}

hope this helps you .....if any problem reply back

Regards

Madhavi

Former Member
0 Kudos

Why equalsIgnoreCase()?

Armin