Skip to content

Commit 99f3556

Browse files
committed
Use domConstruct to always create div node
domConsctruct now always creates a div node and places the contents in that div, causing the appendChild error to no longer occur
1 parent 717779e commit 99f3556

File tree

6 files changed

+141
-1
lines changed

6 files changed

+141
-1
lines changed

src/HTMLSnippet/widget/HTMLSnippet.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ require([
3737
"width": "100%",
3838
"outline": 0
3939
});
40+
4041
domAttr.set(this.domNode, "style", this.style); // might override height and width
41-
domConstruct.place(this.contents, this.domNode, "only");
42+
var n = domConstruct.create("div", { innerHTML: this.contents });
43+
domConstruct.place(n, this.domNode, "only");
4244
}
4345
break;
4446

test/Test.mpr

27 KB
Binary file not shown.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// This file was generated by Mendix Business Modeler.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package appcloudservices.actions;
11+
12+
import com.mendix.systemwideinterfaces.core.IContext;
13+
import com.mendix.webui.CustomJavaAction;
14+
15+
/**
16+
* Generate a valid strong random password for Mendix user
17+
*/
18+
public class GenerateRandomPassword extends CustomJavaAction<String>
19+
{
20+
private Long length;
21+
22+
public GenerateRandomPassword(IContext context, Long length)
23+
{
24+
super(context);
25+
this.length = length;
26+
}
27+
28+
@Override
29+
public String executeAction() throws Exception
30+
{
31+
// BEGIN USER CODE
32+
throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");
33+
// END USER CODE
34+
}
35+
36+
/**
37+
* Returns a string representation of this action
38+
*/
39+
@Override
40+
public String toString()
41+
{
42+
return "GenerateRandomPassword";
43+
}
44+
45+
// BEGIN EXTRA CODE
46+
// END EXTRA CODE
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// This file was generated by Mendix Business Modeler.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package appcloudservices.actions;
11+
12+
import com.mendix.systemwideinterfaces.core.IContext;
13+
import com.mendix.webui.CustomJavaAction;
14+
15+
/**
16+
*
17+
*/
18+
public class LogOutUser extends CustomJavaAction<Boolean>
19+
{
20+
private String openId;
21+
22+
public LogOutUser(IContext context, String openId)
23+
{
24+
super(context);
25+
this.openId = openId;
26+
}
27+
28+
@Override
29+
public Boolean executeAction() throws Exception
30+
{
31+
// BEGIN USER CODE
32+
throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");
33+
// END USER CODE
34+
}
35+
36+
/**
37+
* Returns a string representation of this action
38+
*/
39+
@Override
40+
public String toString()
41+
{
42+
return "LogOutUser";
43+
}
44+
45+
// BEGIN EXTRA CODE
46+
// END EXTRA CODE
47+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// This file was generated by Mendix Business Modeler.
2+
//
3+
// WARNING: Only the following code will be retained when actions are regenerated:
4+
// - the import list
5+
// - the code between BEGIN USER CODE and END USER CODE
6+
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
7+
// Other code you write will be lost the next time you deploy the project.
8+
// Special characters, e.g., é, ö, à, etc. are supported in comments.
9+
10+
package appcloudservices.actions;
11+
12+
import com.mendix.systemwideinterfaces.core.IContext;
13+
import com.mendix.webui.CustomJavaAction;
14+
15+
/**
16+
*
17+
*/
18+
public class StartSignOnServlet extends CustomJavaAction<Boolean>
19+
{
20+
public StartSignOnServlet(IContext context)
21+
{
22+
super(context);
23+
}
24+
25+
@Override
26+
public Boolean executeAction() throws Exception
27+
{
28+
// BEGIN USER CODE
29+
throw new com.mendix.systemwideinterfaces.MendixRuntimeException("Java action was not implemented");
30+
// END USER CODE
31+
}
32+
33+
/**
34+
* Returns a string representation of this action
35+
*/
36+
@Override
37+
public String toString()
38+
{
39+
return "StartSignOnServlet";
40+
}
41+
42+
// BEGIN EXTRA CODE
43+
// END EXTRA CODE
44+
}

test/widgets/HTMLSnippet.mpk

-22.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)