Skip to content

Commit ac29e6c

Browse files
author
Jelte Lagendijk
committed
Cleanup and fix #7
1 parent 83bf34d commit ac29e6c

File tree

5 files changed

+11
-37
lines changed

5 files changed

+11
-37
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CustomString",
3-
"version": "2.2.3",
3+
"version": "2.2.4",
44
"description": "Create a string with a microflow",
55
"license": "",
66
"author": "",

src/CustomString/widget/CustomString.js

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
/*
2-
CustomString
3-
========================
4-
5-
@file : CustomString.js
6-
@version : 2.0.0
7-
@author : Roeland Salij
8-
@date : Thursday, December 03, 2015
9-
@copyright : Mendix 2015
10-
@license : Apache 2
11-
12-
Documentation
13-
========================
14-
Describe your widget here.
15-
*/
16-
171
define([
182
"dojo/_base/declare",
193
"mxui/widget/_WidgetBase",
@@ -34,7 +18,7 @@ define([
3418
sourceMF: "",
3519
renderHTML: "",
3620

37-
// Internal variables. Non-primitives created in the prototype are shared between all widget instances.
21+
// Internal
3822
_handles: null,
3923
_contextObj: null,
4024
_alertDiv: null,
@@ -72,9 +56,7 @@ define([
7256
applyto: "selection",
7357
guids: [ this._contextObj.getGuid() ]
7458
},
75-
callback: function(obj) {
76-
//TODO what to do when all is ok!
77-
},
59+
callback: function(obj) {},
7860
error: lang.hitch(this, function(error) {
7961
console.log(this.id + ": An error occurred while executing microflow: " + error.description);
8062
})
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
2-
// Required module list. Remove unnecessary modules, you can always get them back from the boilerplate.
31
require([
42
"dojo/_base/declare",
53
"dojo/_base/lang",
64
"CustomString/widget/CustomString"
7-
], function (declare, dojoLang,_customStringNoContextWidget) {
5+
], function (declare, lang, _customStringNoContextWidget) {
86

9-
// Declare widget's prototype.
107
return declare("CustomString.widget.CustomStringNoContext", [ _customStringNoContextWidget ], {
118

12-
// dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
139
postCreate: function() {
1410
logger.debug(this.id + ".postCreate");
1511
this._setupEvents();
1612
},
1713

18-
// Attach events to HTML dom elements
1914
_setupEvents: function() {
2015
logger.debug(this.id + "._setupEvents");
2116
if (this.mfToExecute) {
@@ -26,14 +21,14 @@ require([
2621
_render : function (callback) {
2722
logger.debug(this.id + "._render");
2823
mx.ui.action(this.sourceMF, {
29-
callback : dojoLang.hitch(this, this._processSourceMFCallback, callback),
30-
error : dojoLang.hitch(this, function(error) {
24+
callback : lang.hitch(this, this._processSourceMFCallback, callback),
25+
error : lang.hitch(this, function(error) {
3126
alert(error.description);
32-
mendix.lang.nullExec(callback);
27+
this._executeCallback(callback, "_render error cb");
3328
}),
34-
onValidation : dojoLang.hitch(this, function(validations) {
29+
onValidation : lang.hitch(this, function(validations) {
3530
alert("There were " + validations.length + " validation errors");
36-
mendix.lang.nullExec(callback);
31+
this._executeCallback(callback, "_render onvalidation cb");
3732
})
3833
}, this);
3934
},
@@ -44,10 +39,7 @@ require([
4439
mx.ui.action(this.mfToExecute, {}, this);
4540
}
4641
}
47-
4842
});
4943
});
5044

51-
require(["CustomString/widget/CustomStringNoContext"], function() {
52-
"use strict";
53-
});
45+
require(["CustomString/widget/CustomStringNoContext"]);

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="CustomString" version="2.2.3" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="CustomString" version="2.2.4" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="CustomString/CustomString.xml"/>
66
<widgetFile path="CustomString/CustomStringNoContext.xml"/>

test/widgets/CustomString.mpk

-400 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)