GWT设置内部html时出现问题
我在为 gwt HTML 组件设置文本(作为 HTML)时遇到了大麻烦。就我而言,我正在设置 UiBinder 模板,我们将其命名为 foo.ui.xml
...
<g:HTMl ui:field="testfield"/>
...
因为它是一个对话框窗口,我想动态更改该字段的内容。在我的视图类中,
class MyWidget extends PopupPanel {
@UiField
HTML testfield
..
}
当显示弹出窗口时,我设置它的内容
testField.setHTML("<span>Some example <b>of html</b></span>");
,导致异常
Caused by: com.google.gwt.core.client.JavaScriptException: (Error): Nieznany błąd czasu wykonywania.
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.google.gwt.dom.client.Element$.setInnerHTML$(Element.java)
at com.google.gwt.user.client.ui.DirectionalTextHelper.setInnerTextOrHtml(DirectionalTextHelper.java:240)
at com.google.gwt.user.client.ui.DirectionalTextHelper.setTextOrHtml(DirectionalTextHelper.java:184)
at com.google.gwt.user.client.ui.HTML.setHTML(HTML.java:183)
at foo.app.client.popup.MyWidgetUI.setMessage(MyWidgetUI.java:133)
“Nieznany błąd czasu wykonywania”。 - 意思是“执行期间出现未知错误”。
这个bug好像只出现在IE6,7浏览器上。关于原因或解决方案有什么想法吗?
I'm having big trouble while setting text (as HTML) for gwt HTML component. In my case I'm setting my UiBinder template, let's call it foo.ui.xml
...
<g:HTMl ui:field="testfield"/>
...
Because it's a dialog window I want to dynamically change content of this field. In my View class
class MyWidget extends PopupPanel {
@UiField
HTML testfield
..
}
When showing up popup I'm setting it's content
testField.setHTML("<span>Some example <b>of html</b></span>");
Resulting in exception
Caused by: com.google.gwt.core.client.JavaScriptException: (Error): Nieznany błąd czasu wykonywania.
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:237)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:132)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.google.gwt.dom.client.Element$.setInnerHTML$(Element.java)
at com.google.gwt.user.client.ui.DirectionalTextHelper.setInnerTextOrHtml(DirectionalTextHelper.java:240)
at com.google.gwt.user.client.ui.DirectionalTextHelper.setTextOrHtml(DirectionalTextHelper.java:184)
at com.google.gwt.user.client.ui.HTML.setHTML(HTML.java:183)
at foo.app.client.popup.MyWidgetUI.setMessage(MyWidgetUI.java:133)
'Nieznany błąd czasu wykonywania.' - means something like 'Unknown error during execution time'.
This bug seems to occur only on IE6,7 browsers. Any ideas about a cause or solution ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论