Simple Request Focus Issue

I have a tab panel with several tabs. I want to validate a field located on one of the tabs.

If the validation fails, I want to request focus on the tab form / and field. I tried manually coding it, but it was not an available element in the method editor tree, so I figured it would not work.

if (return_shipping_acct_id == null)
{
plugins.dialogs.showErrorDialog(‘Validation Error’, ‘Please enter a valid Return Shipping Account.’,‘OK’);
elements.tabs_70.Return_Shipping_Acct_Number.requestFocus();
return
}

I also played around with the tab element options (get / Set) but cannot figure out how to get a specific tab form to open

I am guessing its a simple index command.

thanks for any help!

Out of my head: I think you should try to access the field you want the focus for by the form. So instead of

elements.tabs_70.Return_Shipping_Acct_Number.requestFocus();

something like

forms.Return_Shipping_Acct_Number.elements.your_field.requestFocus();

and make sure the tab index is on the tab where the user sees the field.

Well, that was a great Idea, I accessed the element and the form directly. the focus went to the field, but the tab in which the field is located, still does not come to focus (open) (I have 5 other tabs in theis tab panel)

if (return_shipping_acct_id == null)
{
plugins.dialogs.showErrorDialog(‘Validation Error’, ‘Please enter a valid Return Shipping Account.’,‘OK’);
forms.TPEPurchaseEvalReturnShippingInfo.elements.Return_Shipping_Acct_Number.requestFocus();
return
}

TPEPurchaseEvalReturnShippingInfo <~~ this is the actual form, that is under one of my tabs in the main form I am validating.

Return_Shipping_Acct_Number <~~ that is the Field I am trying to request focus to.

I just need to get the tab that the field is located in to gain focus.

In the main form the tab panel is called tabs_70. I can name the tab Itself, but only the tab panel shows up on the element tree.

maybe I don’t understand your problem, but that’s what I meant with

and make sure the tab index is on the tab where the user sees the field.

Can’t you use that elements.tabs_70.tabIndex(3) (don’t know exactly, Servoy closed) to jump to the third tab?

Sorry, I did not finish reading your original post, thats what I was looking for, I figured it was a index issue. Thanks for the help

elements.tabs_70.tabIndex = 4

thanks again