getTabNameAt

getTabNameAt() of tabpanel returns the form name of the form contained in the tabpanel. I think it is supposed to return the name assigned for the tab.

Thanks
Hameed

Any servoyians can respond to this?

This is quite important to me. I wanted to use the tab name to capture which tab the user curretly is in. I trigger a method during onShow method of the tabPanel form

Any feedback from servoy people??

try getTabTextAt()

I think what faheemhameed means is that getTabNameAt should return the name of the Tab which you set in Dveloper.

This is a new feature added in 2.2.

Haven’t tested it, but if that actually returns the name of the form, this would be a bug I think.

getTabTextAt is something different. It should return the (i18n-able) displayed text of the tab.

Paul

ok, so we’re talking about name PROPERTY of the tab inside the tabpanel.
Will check and report back.

To be able to retrieve the name of the form in a tab is a useful feature, too! So please don’t fix one for the other :lol:

There’s another function for that, if my memory serves me well… (allthough that works on the currently selected tab only)

Paul

That method is

getSelectedTabFormName()

Will this be fixed in the RC8?? This would be very helpful to me.

Thanks…

I also need a function called elements.tabPanel.getFormNameAt(tabIndex)

This should return the tab form name similar to getSelectedTabFormName but for the given tabIndex

Thanks

any news??

that tab name doesn’t do anything anywhere.
The developer property will be removed in the next version. You only have 2 things: The tab text and the tab form name.

Hi Johan,

Why is that?!?!

It is a very usefull feature, I’d say.

It allows us developers to identify a specific tab, based on the name given to it, a name that is not dependant on I18N and that can be unique. The tabformname is not unique, if you have multiple tabs on one tabpanel, showing the same form.

Don’t you remember the discussion on the forum that lead to this property?

Paul

What do you want to do on that property
even with 2.2 you don’t have that property given to you so you can’t work with it.

If you get that name then you should also be able to do something with it. What kind of things should that be?

the getTabNameAt(n) is/was supposed to return the name set on the elements which represents the tab of a tabpanel in designmode, if I’m not mistaken.

When that works, then you have a text identifier for every tab, that is I18N independant. You’ll need it to uniquely identify a tab, especially after removing tabs.

What should be added as well is the ability to add the name of a tab that is added at runtime. Currently, that is not possible. The name of the tab is now set to the added formname, which causes a problem if you add multiple tabs with the same form.

Paul

I have a parent form (for ex. class) & I have history records showing all the students within a related tab panel.

Also I have more related tabs showing different related records.

I have a button to add/remove (edit relation) students from a class. This add/remove button calls a single function (editRelation) that accepts a parameter. That parameter is used to distinguish which relation the user is editing. There many other parent forms with many other related tabs within a tab panel. I use just one button “add/remove” and one function “editRelation” for all the tab panels.

I want to make the tabName property as the parameter for the function. Ofcourse I do not want to use the tabText as parameter since there are i18n issues and also we can set the tab text same for two tabs (under two different parent forms) but they actually means different.

So I think we must have this property and it is very very handy for me in this situation.

Currently I have to prepare the parameter for the function “editRelation” something similar to the following:

if (parentRoom == "class") {
   if (tabText == "students") {
      paramForEditRelation = "class_student";
   }
   else if (tabText == "....") {
      paramForEditRelation = "class_...";
   }
}
else if (parentRoom == "....") {
   ...
   ...
}

Since curretly I am not using i18n in my solution, I have no problem with the above one eventhough it is a bit ugly.

So please activate that function so that it works as expected.

Thanks a lot,

I like the idea of paul. That is setting the name for a tab when adding it in the runtime.

faheemhameed,

one thing i don’t get
How do you call that method with that tabname?
Where is the tabname comming from?

do you have somewhere in youre code:

doTabWork(‘thesecondtabname’)

??

because if you do that why not directly:

doTabWork(‘therelationiwantdosomethingwith’)

Hi,

How was this topic continued? Has the etTabNameAt() function been altered so it actually returns the name set on a tab?

This is what the docs say:

Function getTabNameAt
Description Returns the name - the “name” design time property value - for a specified tab of a tabpanel.
Syntax elements.elementName.getTabNameAt(number)
Parameters number - the number of the specified tab

So, I think the function should not return the name of the form in the tab, but the name set on the tab in designer.

Still open is the request that we would be able to set the name for a tab added at runtime with the addTab function.

To answer Johan’s question what can be done with these functions: Having these functions allows for uniquely dentifying a certain tab from among others that all have the same form in them.

Paul