diff --git a/src/Ratings/ratings_nologic.xml b/src/Ratings/ratings_nologic.xml
index a355595..abf0a97 100644
--- a/src/Ratings/ratings_nologic.xml
+++ b/src/Ratings/ratings_nologic.xml
@@ -42,5 +42,11 @@
+
+ On change microflow
+ Behavior
+ Microflow to be executed when the rate is changed
+
+
diff --git a/src/Ratings/widget/ratings_nologic.js b/src/Ratings/widget/ratings_nologic.js
index 6ad0cc1..160c346 100644
--- a/src/Ratings/widget/ratings_nologic.js
+++ b/src/Ratings/widget/ratings_nologic.js
@@ -12,11 +12,15 @@ define([
return declare("Ratings.widget.ratings_nologic", [ _WidgetBase, _TemplatedMixin ], {
templateString : widgetTemplate,
- name : "",
+
+ // Modeler properties
voteEnabled : false,
standardImage : "",
mouseoverImage : "",
+ name : "",
+ onChangeMicroflow: "",
+ // Internal properties
divNode : "",
mouseoverArray : null,
root : window.mx.appUrl,
@@ -39,7 +43,7 @@ define([
logger.debug(this.id + "._setValueAttr");
this.oldvalue = parseInt(value, 10);
this.newvalue = parseInt(value, 10);
- if (this.newvalue > 0) {
+ if (this.newvalue >= 0) {
this.setRating(this.newvalue);
} else if (this.mxcontext.getTrackObject()) {
domClass.remove(this.domNode, "hidden");
@@ -109,6 +113,7 @@ define([
this.newvalue = count;
if (this.newvalue !== this.oldvalue) {
this.onChange();
+ this._callMicroflow(this.onChangeMicroflow);
}
this.displayImages(count);
@@ -131,6 +136,19 @@ define([
this.setMouseOver(showVote - 1);
},
+ _callMicroflow: function(microflowName) {
+ if (microflowName) {
+ window.mx.ui.action(microflowName, {
+ context: this.mxcontext,
+ origin: this.mxform,
+ callback: function() { },
+ error: function(error) {
+ window.mx.ui.error("Error executing microflow: " + microflowName + " " + error.message);
+ }
+ });
+ }
+ },
+
uninitialize : function(){
logger.debug(this.id + ".uninitialize");
for (var i = 0; i < this.mouseoverArray.length; i++){