Browse Source

Merge pull request #814 in DESIGN/design from ~RICHIE/design:release/10.0 to release/10.0

* commit 'da86f47dde97cee129735dd80ee952cd0f75aa52':
  无JIRA任务 修改populate的时候的一个小bug
bugfix/10.0
richie 6 years ago
parent
commit
c65e5d60bc
  1. 6
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  2. 6
      designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js
  3. 6
      designer-base/src/test/resources/com/fr/design/ui/demo.html

6
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -105,14 +105,12 @@ public class ModernUIPane<T> extends BasicPane {
public void populate(final T t) {
browser.addLoadListener(new LoadAdapter() {
browser.addScriptContextListener(new ScriptContextAdapter() {
@Override
public void onFinishLoadingFrame(FinishLoadingEvent event) {
if (event.isMainFrame()) {
public void onScriptContextCreated(ScriptContextEvent event) {
JSValue ns = event.getBrowser().executeJavaScriptAndReturnValue("window." + namespace);
ns.asObject().setProperty(variable, t);
}
}
});
}

6
designer-base/src/main/resources/com/fr/design/ui/InitNameSpace.js

@ -1,6 +1,6 @@
var arr ="%s".split(".").reverse();
var create = function (obj, names) {
var name = names.pop();
let arr ="%s".split(".").reverse();
let create = function (obj, names) {
let name = names.pop();
if (!name) {
return;
}

6
designer-base/src/test/resources/com/fr/design/ui/demo.html

@ -10,6 +10,12 @@
return Pool.data;
};
</script>
<script type="text/javascript">
window.onload = function () {
document.getElementById("name").value = Pool.data.getName();
document.getElementById("age").value = Pool.data.getAge();
};
</script>
</head>
<body>
<div>测试页面,请点击最下面的按钮</div>

Loading…
Cancel
Save