Skip to content

Commit

Permalink
Merge pull request #10 from gajduk/master
Browse files Browse the repository at this point in the history
Added option to select nanoflow
  • Loading branch information
remcos authored Jan 2, 2019
2 parents 21b48ae + fa09407 commit 6e9bc77
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
10 changes: 8 additions & 2 deletions ShowByCondition/src/ShowByCondition/ShowByCondition.xml

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions ShowByCondition/src/ShowByCondition/widget/ShowByCondition.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ define([

// Parameters configured in the Modeler.
microflowName: "",
nanoflowName: "",
returnValue: "",
elementClassFalse: "",
elementClassTrue: "",
Expand Down Expand Up @@ -102,10 +103,26 @@ define([
this.setParentDisplay(result);
}),
error: function(error) {
alert(error.description);
console.error(error.description);
}
}, this);
}
else if (this.nanoflowName != '') {
mx.data.callNanoflow({
nanoflow: this.nanoflowName,
origin: this.mxform,
context: this.mxcontext,
callback: dojo.hitch(this, function (result) {
this.setParentDisplay(result);
}),
error: function(error) {
console.error(error.description);
}
}, this);
}
else {
console.error("Neither a nanoflow or a microflow was specified for show by condition widget.");
}
}

        },
Expand All @@ -114,9 +131,9 @@ define([
            var _objectHandle = null;
            // Release handles on previous object, if any.
            if (this._handles) {
                this._handles.forEach(function (handle, i) {
                    mx.data.unsubscribe(handle);
                });
                this._handles.forEach(lang.hitch(this, function (handle, i) {
                this.unsubscribe(handle);
                }));
                this._handles = [];
            }
            // When a mendix object exists create subscribtions.
Expand Down
2 changes: 1 addition & 1 deletion ShowByCondition/src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="ShowByCondition" version="1.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="ShowByCondition" version="1.4.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="ShowByCondition/ShowByCondition.xml" />
</widgetFiles>
Expand Down
Binary file not shown.
Binary file modified ShowByCondition/test/Widget/ShowByCondition.mpk
Binary file not shown.

0 comments on commit 6e9bc77

Please sign in to comment.