Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
a_f:a:exec_script [2022/09/01 01:23] – removed - external edit (Unknown date) 127.0.0.1a_f:a:exec_script [2025/06/12 03:59] (current) – Change to AwareIM aware_support3
Line 1: Line 1:
 +{{tag>Index Action Action_List Process}}
 +====== EXEC_SCRIPT ======
 +
 +This action runs the specified Javascript inside the browser of the current user that started the process with this action. 
 +
 +===== Syntax =====
 +
 +''EXEC_SCRIPT'' ArithmeticExpression()
 +
 +where ArithmeticExpression is either a string or an attribute containing a string with a script. 
 +
 +===== Example =====
 +
 +<code aim>EXEC_SCRIPT 'AwareApp.closeComponent(parser.m_widgetInfo,false,false);' </code>
 +
 +//**AwareIM**// exposes a special object called "parser' to the script run through this action. This object represents a form or query parser that the process has been started with. This way the developer can use this object to perform some operations with a form or a query before or after the process starts. The above script, for example, will close the current form or query if the process that contains this action has been started from the form or query. If the process hasn’t been started from the form or query the “parser” object is null.
 +
 +Some more example of the script execution. The following one will select the second tab in a visual perspective:
 +
 +<code aim>EXEC_SCRIPT 'AwareApp.getMainTabPanel().select(1);' </code>
 +
 +The following script select a tab in a visual perspective with id “User”:
 +
 +<code aim>EXEC_SCRIPT `var tabIdx = $('#' + AwareApp.m_mainTabPanelId).find('[aw-tab-id=User]').parent().index()-1; AwareApp.getMainTabPanel().select(tabIdx);` </code>
 +
 +Please see the [[docs:3500|Programmers Reference]] document for more details on how to use Javascript in AwareIM.
 +
 +