Tab Control Problem - on which tab is the user

Hi! I am working on a form with two tabs, but i need to know on which tab the user is…tab1 or tab2…is that possible, if it is, how? :slight_smile: thx Stophi

This is not by a standard function as far as i know. But with a little trick you might be able to do something but it may be not reliable. I dont know. When you click on a tab you will notice that an onactivate trigger will be triggered of a control on that specific tab (if there are any that can receive focus). You could use that trigger to set some kind of variable wich you can later use to determine wich tab is visible. Good luck

What task do you want to accomplish? Do you need to know what field has been updated? Most of the time, you can do it with the OnValidate Trigger, in the table.

Just to confirm what Jan-Pieter is suggesting, have a look at Form 402 - Sales Order Statistics. Every focusable control has an OnActivate trigger with the code like: SetVATSpecification(ActiveTab::General); Hope that helps, Jesús Soage

I know a little workaround for this which should work fine :slight_smile: Everytime a new tab is selected the first element on this tab is activated and the OnActivate Trigger of this element is called!

That’s true if - the first element on the Tab has the property Focusable= - you don’t use the propety NextControl to choose the next control to get the focus - … (maybe others)

quote:


Originally posted by blum
I know a little workaround for this which should work fine :slight_smile: Everytime a new tab is selected the first element on this tab is activated and the OnActivate Trigger of this element is called!


That’s not quite true. That happens ONLY when you use the mouse to select a TAB. When you move e.g. from the first to the third TAB initiated by the NextControl-property that first element on the third TAB will not be triggered. Here is either an error with the NextControl-property or a ‘missing’ property/control as well in the client: by using the NextControl and tab-key you can jump to the field selected in the NextControl-property. But using shift and tab-key will not return to the field ‘where you came form’ but the previous field. Either a new field under properties (e.g. ‘PreviousControl’) should be set up or the logic when using the shift and tab-key should be ‘reversed’ like a ‘where did I came from’. I prefer the ‘where did I came from’ solution but both are fine. I can imagine some tasks for the ‘PreviousControl’-solution. However, I requested that function since Version 1.3 but nothing happened.

You also have an initial problem if you leave and reenter the form (with SaveControlInfo=Yes)

Thx! I change the design…so i don’t need two tabs :slight_smile: cheers