tabpanel.setTabText

Today I tried a workaround for the missing tabpanel.setTabVisible(tabindex). I tried to change the text of a tab and attach another form…

Would it be possible to get a tabpanel.setTabText(tabindex, textstring)?

Thanks

Why should the tab text ever change? seems strange to me…

OK: let’s say I have a view with customer details including a tab with invoice data, order data and offer data etc.

The view is available to everybody but the tab with that administration data should change into a tab with only order data.

Today this tab is named ‘administration’ but it would be nice if I could call it ‘orders’ when it shows only order data…

Jan, can this be done?

tabpanel.setTabVisible(tabindex).

No a tabpanel does not support such an option, it is only possible to enable/disable tabs.

So, hiding a tab through scripting will never be possible? :( That’s really a shame… Very much would have liked that function…

Also, can the Tab text be altered? I’m playing around with it, but for example %%maxRecordIndex%% on ToolTipText or Text on a specific tab doesn’t work. It shows the literal “%%maxRecordIndex%%”.

(What I’m trying to do is show the TabName as Bold when the foundset of the form on the tab is <> zero)

Paul

I was wondering: If hidding tabs that you allready added through develloper is not possible, would it then be possible to dynamically, through scripting, add (all) tabs with an OnLoad method?

If this would be possible, we could place a tabpanel without tabs on a form and then, through scripting add the tabs we need…

Paul

yes please! :)
That would be wonderful!

The tabpanel component does not support dynamical add/remove of tabs…is disable tab not sufficient?

It is, for me, nearly sufficient.

Concider this:

I show 3 tabs in an overview. 2 out of 4 should not be public and are therefore disabled.

This raises questions and curiosity. Not when they are hidden. The user just doesn’t know they are there.

One can overcome this but then we would have to build extra forms…

If and when I am correct this would result in the following.

Instead of 1 tabpanel and 4 forms:

1 (hidden) tabpanel with 2 tabs
1 tab holds extra form for view with 4 tabs tabpanel
1 tab holds extra form for view with 2 tabs tabpanel

So the final result would be 2 extra forms and possibly some extra/double scripting …

Jan, I think the most of us, develop in modules, one customer(transport company) has CRM with module: invoices en planning etc. and the other costumer(electrician) has CRM with only module: invoices etc..
and again an other costumers has a special build module, for him only!

but the electrician, if he sees the tabpannel: transport, or something else he would think he bought the wrong software!

So it would be handy, if we could hide them.
because: module developing is not implemented yet, we have to do it, this way.

Also check the discussing in topic:

http://forum.servoy.com/viewtopic.php?t=530&highlight=

In my solution, on a custoemr I have a tabpanel for productoffering. Each tab hold the products in a productgroup. Now, I also have different CompanyTypes and not every CompanyType has the same Productgroups available.

So, if I could hide tabs (or dynamically create them), if I open a custoemr op CompanyType I, i only show the tabs for productgroups A,B & D. If I open a customer of CompanyType II, I show the tabs for productgroups B,C,D and F etc.

Now, the best way would be to dynamically create the tabs, because then I do not have to specify each tab before hand…

Just disabling tabs would be messy towards the users. And Marcels workaround is a lot more work and not very flexible..

Paul

Making it available through a method is fairly complex for us. So yes it is feasible but I hope you’ll let us build other stuff first.

You can already achieve what you want to do by using a tabpanel with tab orientation set to none and design your own navigation above it.

In the end, it’s a feature I would really, really like, but for now I can work around it.

Paul

okM-i, okM-i!

but I hope you’ll let us build other stuff first

Servoy Mobile? :lol:

BTW: what about my original question?

Also, can the Tab text be altered? I’m playing around with it, but for example %%maxRecordIndex%% on ToolTipText or Text on a specific tab doesn’t work. It shows the literal “%%maxRecordIndex%%”.

Paul

in Servoy 2.0 rc8 it will be possible to do this:

elements.mytabpane.setTabTextAt(3,'newTitle')
var tabText = elements.mytabpane.getTabTextAt(3)

Suuuuper. Thanks guys…

Does this mean that it will not be possible to use tags when setting the Text (or the ToolTipText) in a tab in a TabPanel through the property editor?

When setting the Text or ToolTipText property of a Tab through the property editor and you use tags, in view mode, you get back the literal %%…%% (meaning: the tags is not evaluated)

Paul

Ah, we never thought of the tag use in tab text, is it needed?