Skip to content

Commit 05b2b78

Browse files
author
Jelte Lagendijk
committed
Fix #4 widget does not render when HTML is set to No
1 parent bc3f743 commit 05b2b78

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CustomString",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Create a string with a microflow",
55
"license": "",
66
"author": "",
@@ -34,4 +34,4 @@
3434
"scripts": {
3535
"test": "grunt test"
3636
}
37-
}
37+
}

src/CustomString/widget/CustomString.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ define([
2121
"dijit/_TemplatedMixin",
2222
"dojo/_base/array",
2323
"dojo/_base/lang",
24+
"dojo/html",
2425
"mxui/dom",
2526
"dojo/text!CustomString/widget/template/CustomString.html"
26-
], function(declare, _WidgetBase, _TemplatedMixin, dojoArray, dojoLang, dom, widgetTemplate) {
27+
], function(declare, _WidgetBase, _TemplatedMixin, dojoArray, dojoLang, html, dom, widgetTemplate) {
2728
"use strict";
2829

2930
// Declare widget's prototype.
@@ -102,6 +103,9 @@ define([
102103
guids : [this._contextObj.getGuid()]
103104

104105
},
106+
store: {
107+
caller: this.mxform
108+
},
105109
callback : dojoLang.hitch(this, this._processSourceMFCallback, callback),
106110
error : dojoLang.hitch(this, function(error) {
107111
alert(error.description);
@@ -117,13 +121,14 @@ define([
117121

118122
_processSourceMFCallback: function (callback, returnedString) {
119123
logger.debug(this.id + "._processSourceMFCallback");
120-
this.customString.innerHTML = this.checkString(returnedString, this.renderHTML);
124+
html.set(this.customString, this.checkString(returnedString, this.renderHTML));
121125
mendix.lang.nullExec(callback);
122126
},
123127

124128
checkString : function (string, htmlBool) {
125129
logger.debug(this.id + ".checkString");
126130
if (string.indexOf("<script") > -1 || !htmlBool) {
131+
logger.debug(this.id + ".checkString escape String");
127132
string = dom.escapeString(string);
128133
}
129134
return string;

src/CustomString/widget/CustomStringNoContext.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ require([
2929
params : {
3030
actionname : this.sourceMF
3131
},
32+
store: {
33+
caller: this.mxform
34+
},
3235
callback : dojoLang.hitch(this, this._processSourceMFCallback, callback),
3336
error : dojoLang.hitch(this, function(error) {
3437
alert(error.description);

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.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="CustomString" version="2.2.1" 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

18 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)