on 11-24-2004 11:24 AM
Helllo,
I am using a Tab Strip with 5 Tab pages. At runtime i want to know which tab has the focus at the moment to user hist a button.
How can i do that
Bertil
Bind <b>selectedTab</b> property of TabStrib to context attribute. Then you can read ID of currently selected via reading context attribute and even change currently selected tab simply by assigning value to attribute.
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What does it means by "name of UI element event parameter"? Can you show us an example?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When we click on a Tab, we would like to fire out to another view. Attached are coding:
public static void wdDoModifyView(IPrivateRatingMainView wdThis, IPrivateRatingMainView.IContextNode wdContext,
com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
IWDTabStrip iwdTabStrip = (IWDTabStrip)view.getElement("tsRatingMain");
String selectedTab = iwdTabStrip.getSelectedTab();
crrsLogger.info("selectedTab " + selectedTab);
wdContext.currentContextElement().setQualitativeTab(selectedTab);
}
public void onActionRatingMode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String mode )
{
String selectedTab = wdContext.currentContextElement().getQualitativeTab();
crrsLogger.info("onActionRatingMode selectedTab " + selectedTab);
if (selectedTab.equals("tabQualitative"))
{
crrsLogger.info("Execute Fire Plug");
wdThis.wdFirePlugToLargeCorp();
}
}
But, the problem is, "wdModifyView" is always called first before "onActionRatingMode". So, the value of selectedTab is always refer to the previously called tab.
Any suggestion is kind appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How to access the selected tab ID in an action event handler after switching to a new tab:
1. Add parameter, e.g. "selectedTab", to your action event handler.
2. In wdDoModifyView(), declare an event parameter mapping for the parameter "tab" of event IWDTabStrip.onSelect:
if (firstTime)
{
IWDTabStrip tabstrip = (IWDTabStrip)
view.getElement(<tabstripID>);
tabstrip.mappingOfOnSelect().addSourceMapping(
"tab", /* name of UI element event parameter */
"selectedTab" /* name of action handler parameter */
);
}
Then you get the ID of the new selected tab in your action event handler through parameter "selectedTab".
Armin
Hi,
The solution that was mentioned works fine!
thanks for helping
Bertil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You mean the ID of the currently selected tab?
See:
IWDTabStrip.getSelectedTab()
or if you need access in an event handler: Bind the selectedTab property and ask the view context for the current value.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.