on 03-01-2006 10:01 AM
Hello everybody,
how do I get the selectedTab, when the onSelectAction on the TabStrip is processed?
Thanks a lot, Regards Mario
Bind the "selectedTab" property to a context attribute. Then you can always get the ID of the selected tab from this attribute.
Otherwise, you have to define a parameter mapping for the "onSelect" parameter "tab".
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario,
You can have a context value attribute (of type String) which can store the current id of the selected tab.
In the wdDoModifyView method of the view,
you can do:
IWDTabStrip tab = (IWDTabStrip)view.getElement("<tab strip id>");
wdContext.currentContextElement.set<value attribute>(tab.getSelectedTab());
From the context you can get the currently selected tab id.
RK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, Mario, you are correct -- Radha's example will not work.
But my example will work -- parameter binding will be performed before view is shown to user for first time (so before any action on this view).
Btw, approach with context binding (see Armin's and Noufal's posts) is simpler and quicker. Use parameter mapping only if you need previous tab ID as well.
VS
Marion,
1. Declare 2 string parameters for onSelect action handler, say "paramNewTab", "paramPrevTab", type string.
2. Add the following to wdDoModifyView:
if (firstTime)
{
final IWDTabStrip aTabStrip
= (IWDTabStrip)view.getElement("<tabStripID>");
aTabStrip.mappingOfOnSelect().addSourceMapping
(
"tab" /*IWDTabStrip.IWDOnSelect.TAB*/,
"paramNewTab"
);
aTabStrip.mappingOfOnSelect().addSourceMapping
(
"oldTab" /*IWDTabStrip.IWDOnSelect.OLD_TAB*/,
"paramPrevTab"
);
}
3. In action handler "paramNewTab" variable will contains ID of selected tab.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.