tabIndex by Name Issue

Version: 5.2.6 - build 1011

Perhaps, someone could verify this issue.

The Servoy wiki states the following:

// or sets (goes to) the tab with the specified name
// forms.customer.elements.customer_id.tabIndex = ‘tab_name’;

which is not entirely true. By default, when creating a tab panel, the tab names are taken from their respective form names. If you then attempt to set a tab reference by its name:

forms.customer.elements.customer_id.tabIndex = 'tab_name'

is will not work (the forms within the tab panel do not change, no error messasges emitted). I discovered that you have to rename the tab names to something other than their respective form names in order to get things to work.

Is this the way it’s supposed to work?

if you did not set the name of the tab in the designer, you also can’t use that tabIndex by name in scripting.
You have to name your tabpanels first before you can do that

Are you sure you’re not confusing the tab’s text property with the name property? I don’t think that the name of tabs get’s automatically set, you need to do that yourself.

Paul

Yikes! I doubled-checked things and found that I was, in fact, confusing the tab text with its name (which was not defined). And, the default is that the tab text is named after the form. Thank you Johan and Paul for the correction.

“I never know whether to pity or congratulate a man on coming to his senses.”

  • William M. Thackeray