Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 29 additions & 25 deletions src/CustomString/widget/CustomString.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,41 @@ define([
this.connect(this.customString, "click", function(e) {
// If a microflow has been set execute the microflow on a click.
if (this.mfToExecute !== "") {
mx.ui.action(this.mfToExecute, {
params: {
applyto: "selection",
guids: [ this._contextObj.getGuid() ]
},
callback: function(obj) {},
error: lang.hitch(this, function(error) {
console.log(this.id + ": An error occurred while executing microflow: " + error.description);
})
}, this);
mx.data.action(
{
params: {
actionname: this.mfToExecute,
applyto: "selection",
guids: [this._contextObj.getGuid()]
},
callback: function(obj) {},
error: lang.hitch(this, function(error) {
console.log(this.id + ": An error occurred while executing microflow: " + error.description);
})
}, this);
}
});
},

_updateRendering : function (callback) {
logger.debug(this.id + "._updateRendering");
mx.ui.action(this.sourceMF, {
params: {
applyto : "selection",
guids : [this._contextObj.getGuid()]
},
callback : lang.hitch(this, this._processSourceMFCallback, callback),
error : lang.hitch(this, function(error) {
alert(error.description);
this._executeCallback(callback, "_updateRendering error");
}),
onValidation : lang.hitch(this, function(validations) {
alert("There were " + validations.length + " validation errors");
this._executeCallback(callback, "_updateRendering onValidation");
})
}, this);
mx.data.action(
{
params: {
actionname: this.sourceMF,
applyto: "selection",
guids: [this._contextObj.getGuid()],
},
callback: lang.hitch(this, this._processSourceMFCallback, callback),
error: lang.hitch(this, function(error) {
alert(error.description);
this._executeCallback(callback, "_updateRendering error");
}),
onValidation: lang.hitch(this, function(validations) {
alert("There were " + validations.length + " validation errors");
this._executeCallback(callback, "_updateRendering onValidation");
})
}, this);
},

_processSourceMFCallback: function (callback, returnedString) {
Expand Down
33 changes: 21 additions & 12 deletions src/CustomString/widget/CustomStringNoContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,32 @@ require([

_render : function (callback) {
logger.debug(this.id + "._render");
mx.ui.action(this.sourceMF, {
callback : lang.hitch(this, this._processSourceMFCallback, callback),
error : lang.hitch(this, function(error) {
alert(error.description);
this._executeCallback(callback, "_render error cb");
}),
onValidation : lang.hitch(this, function(validations) {
alert("There were " + validations.length + " validation errors");
this._executeCallback(callback, "_render onvalidation cb");
})
}, this);
mx.data.action(
{
params: {
actionname: this.sourceMF,
},
callback: lang.hitch(this, this._processSourceMFCallback, callback),
error: lang.hitch(this, function(error) {
alert(error.description);
this._executeCallback(callback, "_render error cb");
}),
onValidation: lang.hitch(this, function(validations) {
alert("There were " + validations.length + " validation errors");
this._executeCallback(callback, "_render onvalidation cb");
})
}, this);
},

_executeMicroflow: function () {
logger.debug(this.id + "._executeMicroflow");
if (this.mfToExecute) {
mx.ui.action(this.mfToExecute, {}, this);
mx.data.action(
{
params: {
actionname: this.mfToExecute,
},
}, this);
}
}
});
Expand Down