SetActiveTab method (WinStudio scripts)
Applies to
IWSForm Interface
Definition
Activates the specified IdsTabContent within its parent IdsTabsContext. This method applies only to IDS forms and returns true when the navigation is successful.
- Finds the component by name.
- Verifies that the component type is
ComponentTypes.IdsTabContent. - Traverses the component hierarchy to locate the parent
IdsTabsContext. - Sets the ActiveTab property on the parent context.
Syntax
object.SetActiveTab(string)
| Part | Description |
|---|---|
| object | Required. The name of a valid form object. |
| string | Required. The component name of the tab to receive the focus. |
Remarks
This API supports headerless ID tabs, which provide functionality similar to form pages in Classic forms. In this approach, headerless tabs represent individual pages, and navigation is controlled programmatically.
To support page-style navigation, you can add a GOTO_TAB event handler response. This response is the IDS equivalent of the classic GOTO_FORMPAGE event and allow form logic to start a specific headerless tab when required.
Script support is also available through the SetActiveTab and GetActiveTab methods. The SetActiveTab activates a specified headerless tab, and the GetActiveTab returns the currently active tab. Together, these capabilities enable headerless IDS tabs to function similar to form pages in Classic forms.
Example
using System;
using Mongoose.IDO.Protocol;
using Mongoose.Scripting;
namespace Mongoose.FormScripts
{
public class theForm : FormScript
{
/// <summary>
/// Navigates to the "Details" tab when the user clicks a button.
/// The component "tabContentDetails" must be an IdsTabContent inside an IdsTabsContext.
/// </summary>
public void ShowDetailsTab()
{
bool success = ThisForm.SetActiveTab( "tabContentDetails" );
if ( !success )
{
Application.ShowMessage( "Unable to navigate to the Details tab." );
}
}
}