Skip to content

Commit 83ca76b

Browse files
author
JelteMX
committed
Update empty boilerplate with updated methods
1 parent ef025b1 commit 83ca76b

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

generators/app/templates/WidgetBoilerplate/src/WidgetName/widget/WidgetName.js.ejs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,36 @@ define([
6666
dojoStyle.set(this.domNode, "display", "none");
6767
}
6868

69-
this._executeCallback(callback);
69+
this._executeCallback(callback, "_updateRendering");
7070
},
7171

72-
_executeCallback: function (cb) {
73-
if (cb && typeof cb === "function") {
74-
cb();
75-
}
72+
// Shorthand for running a microflow
73+
_execMf: function (mf, guid, cb) {
74+
logger.debug(this.id + "._execMf");
75+
if (mf && guid) {
76+
mx.ui.action(mf, {
77+
params: {
78+
applyto: "selection",
79+
guids: [guid]
80+
},
81+
callback: lang.hitch(this, function (objs) {
82+
if (cb && typeof cb === "function") {
83+
cb(objs);
84+
}
85+
}),
86+
error: function (error) {
87+
console.debug(error.description);
88+
}
89+
}, this);
90+
}
91+
},
92+
93+
// Shorthand for executing a callback, adds logging to your inspector
94+
_executeCallback: function (cb, from) {
95+
logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
96+
if (cb && typeof cb === "function") {
97+
cb();
98+
}
7699
}
77100
});
78101
});

0 commit comments

Comments
 (0)