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
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.