Custom "onclick" Function in activiti-transitions.js

cancel
Showing results for 
Search instead for 
Did you mean: 
longlong
Member II

Custom "onclick" Function in activiti-transitions.js

Follow:

https://docs.alfresco.com/5.2/references/dev-extension-points-workflow.html

I have followed the instructions above.

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"

I add custom same as below:

------------------

onClick: function ActivitiTransitions_onClick(e, p_obj)
{
//MNT-2196 fix, disable transition button to prevent multiple execution
p_obj.set("disabled", true);
// determine what button was pressed by it's id
var buttonId = p_obj.get("id");
var transitionId = buttonId.substring(this.id.length+1);

// get the hidden field
var hiddenField = this._getHiddenField();

// set the hidden field value
Dom.setAttribute(hiddenField, "value", transitionId);

if (Alfresco.logger.isDebugEnabled())
Alfresco.logger.debug("Set transitions hidden field to: " + transitionId);

// generate the hidden transitions field
this._generateTransitionsHiddenField();

function org_alfresco_training_onActionCallWebScriptSuccess(response) {
Alfresco.util.PopupManager.displayPrompt(
{
title: this.msg("Title"),
text: JSON.stringify(response.json),
buttons: [
{
text: this.msg("button.ok"),
handler: function org_alfresco_training_onActionCallWebScriptSuccess_success_ok() {
this.destroy();
},
isDefault: true
},
{
text: this.msg("button.cancel"),
handler: function org_alfresco_training_onActionCallWebScriptSuccess_cancel() {
this.destroy();
}
}]
});

}

// attempt to submit the form
Alfresco.util.submitForm(p_obj.getForm());
}

------------------

 

I want to showing MessageBox, Did I do something wrong?

Please help me!