<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom &amp;quot;onclick&amp;quot; Function in activiti-transitions.js in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/custom-quot-onclick-quot-function-in-activiti-transitions-js/m-p/23120#M10099</link>
    <description>&lt;P&gt;Follow:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/references/dev-extension-points-workflow.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/references/dev-extension-points-workflow.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have followed the instructions above.&lt;/P&gt;&lt;P&gt;After RUN project I custom "onclick" function in a file "activiti-transitions.js" in the path: "..\alfresco\workflow-tutorial\target\tomcat\webapps\workflow-tutorial-share\components\form\workflow"&lt;/P&gt;&lt;P&gt;I add custom same as below:&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;P&gt;onClick: function ActivitiTransitions_onClick(e, p_obj)&lt;BR /&gt;{&lt;BR /&gt;//MNT-2196 fix, disable transition button to prevent multiple execution&lt;BR /&gt;p_obj.set("disabled", true);&lt;BR /&gt;// determine what button was pressed by it's id&lt;BR /&gt;var buttonId = p_obj.get("id");&lt;BR /&gt;var transitionId = buttonId.substring(this.id.length+1);&lt;BR /&gt;&lt;BR /&gt;// get the hidden field&lt;BR /&gt;var hiddenField = this._getHiddenField();&lt;/P&gt;&lt;P&gt;// set the hidden field value&lt;BR /&gt;Dom.setAttribute(hiddenField, "value", transitionId);&lt;BR /&gt;&lt;BR /&gt;if (Alfresco.logger.isDebugEnabled())&lt;BR /&gt;Alfresco.logger.debug("Set transitions hidden field to: " + transitionId);&lt;BR /&gt;&lt;BR /&gt;// generate the hidden transitions field&lt;BR /&gt;this._generateTransitionsHiddenField();&lt;/P&gt;&lt;P&gt;function org_alfresco_training_onActionCallWebScriptSuccess(response) {&lt;BR /&gt;Alfresco.util.PopupManager.displayPrompt(&lt;BR /&gt;{&lt;BR /&gt;title: this.msg("Title"),&lt;BR /&gt;text: JSON.stringify(response.json),&lt;BR /&gt;buttons: [&lt;BR /&gt;{&lt;BR /&gt;text: this.msg("button.ok"),&lt;BR /&gt;handler: function org_alfresco_training_onActionCallWebScriptSuccess_success_ok() {&lt;BR /&gt;this.destroy();&lt;BR /&gt;},&lt;BR /&gt;isDefault: true&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;text: this.msg("button.cancel"),&lt;BR /&gt;handler: function org_alfresco_training_onActionCallWebScriptSuccess_cancel() {&lt;BR /&gt;this.destroy();&lt;BR /&gt;}&lt;BR /&gt;}]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// attempt to submit the form&lt;BR /&gt;Alfresco.util.submitForm(p_obj.getForm());&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;P&gt;I want to showing MessageBox,&amp;nbsp;&lt;SPAN&gt;Did I do something wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please help me!&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2019 04:06:25 GMT</pubDate>
    <dc:creator>longlong</dc:creator>
    <dc:date>2019-11-19T04:06:25Z</dc:date>
    <item>
      <title>Custom "onclick" Function in activiti-transitions.js</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/custom-quot-onclick-quot-function-in-activiti-transitions-js/m-p/23120#M10099</link>
      <description>&lt;P&gt;Follow:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/5.2/references/dev-extension-points-workflow.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/5.2/references/dev-extension-points-workflow.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have followed the instructions above.&lt;/P&gt;&lt;P&gt;After RUN project I custom "onclick" function in a file "activiti-transitions.js" in the path: "..\alfresco\workflow-tutorial\target\tomcat\webapps\workflow-tutorial-share\components\form\workflow"&lt;/P&gt;&lt;P&gt;I add custom same as below:&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;P&gt;onClick: function ActivitiTransitions_onClick(e, p_obj)&lt;BR /&gt;{&lt;BR /&gt;//MNT-2196 fix, disable transition button to prevent multiple execution&lt;BR /&gt;p_obj.set("disabled", true);&lt;BR /&gt;// determine what button was pressed by it's id&lt;BR /&gt;var buttonId = p_obj.get("id");&lt;BR /&gt;var transitionId = buttonId.substring(this.id.length+1);&lt;BR /&gt;&lt;BR /&gt;// get the hidden field&lt;BR /&gt;var hiddenField = this._getHiddenField();&lt;/P&gt;&lt;P&gt;// set the hidden field value&lt;BR /&gt;Dom.setAttribute(hiddenField, "value", transitionId);&lt;BR /&gt;&lt;BR /&gt;if (Alfresco.logger.isDebugEnabled())&lt;BR /&gt;Alfresco.logger.debug("Set transitions hidden field to: " + transitionId);&lt;BR /&gt;&lt;BR /&gt;// generate the hidden transitions field&lt;BR /&gt;this._generateTransitionsHiddenField();&lt;/P&gt;&lt;P&gt;function org_alfresco_training_onActionCallWebScriptSuccess(response) {&lt;BR /&gt;Alfresco.util.PopupManager.displayPrompt(&lt;BR /&gt;{&lt;BR /&gt;title: this.msg("Title"),&lt;BR /&gt;text: JSON.stringify(response.json),&lt;BR /&gt;buttons: [&lt;BR /&gt;{&lt;BR /&gt;text: this.msg("button.ok"),&lt;BR /&gt;handler: function org_alfresco_training_onActionCallWebScriptSuccess_success_ok() {&lt;BR /&gt;this.destroy();&lt;BR /&gt;},&lt;BR /&gt;isDefault: true&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;text: this.msg("button.cancel"),&lt;BR /&gt;handler: function org_alfresco_training_onActionCallWebScriptSuccess_cancel() {&lt;BR /&gt;this.destroy();&lt;BR /&gt;}&lt;BR /&gt;}]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;// attempt to submit the form&lt;BR /&gt;Alfresco.util.submitForm(p_obj.getForm());&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;------------------&lt;/P&gt;&lt;P&gt;I want to showing MessageBox,&amp;nbsp;&lt;SPAN&gt;Did I do something wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please help me!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 04:06:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/custom-quot-onclick-quot-function-in-activiti-transitions-js/m-p/23120#M10099</guid>
      <dc:creator>longlong</dc:creator>
      <dc:date>2019-11-19T04:06:25Z</dc:date>
    </item>
  </channel>
</rss>

