SBM JavaScript Library Guide → Reference → Event Methods → AddTabCallback
Adds a callback that is invoked when a tab is activated or deactivated.
Name | Type | Description |
---|---|---|
objname | String | The name of the tab. |
callback | Function | The function to be invoked when the tab is activated or deactivated. |
activated | Boolean | Whether to invoke the callback when the tab is activated or deactivated. |
Result | Value |
---|---|
(none) | |
This example registers a named function to be called when a tab is activated or deactivated:
function customTabCallback() { if ( IsFieldEmpty( "Problem" ) ) { ShowErrorDiv( true, "A problem entry is required" ); } else { ShowErrorDiv( false ); } } AddTabCallback( "ProblemsSection", customTabCallback, false );
Callbacks are invoked in the order in which they are added. This callback can be used to perform validation or other data verification. If you want to display a field validation error, call MakeFieldInvalid from this callback so that any required or invalid field errors are automatically processed.
Copyright © 2007–2015 Serena Software, Inc. All rights reserved.