有没有办法在 GWT 中设置小部件的 MIME 类型
我有这样的场景,我想在基于单击事件的对话框中显示作为字符串的 xml。
但现在该字符串显示为连续字符串,看起来不像 xml 格式的字符串。
我想知道是否可以将任何小部件的 MIME 类型设置为 - text/xml,以便正确显示 xml 内容。
I have this scenario where I want to display the xml which is coming as a string in a dialog box based on a click event.
But now the string is showing as continuous string and does not look like a xml formatted string.
I was wondering if I could set the MIME type of any widget to say - text/xml so that the xml content is displayed properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将输出包装在
请参阅第 58 行的
getSource()
函数。他使用 SafeHtml 对象来构建格式良好的 XML 输出。在某些时候,我相信您必须将其包装在g:HTMLPanel
或常规div
中。希望有帮助。
-tjw
You can wrap the output in a
<pre>
tag to make it monospace and formatted exactly as your Java string dictates with tabs, newlines, and whatever else you want to throw in there. An example is here: GXT UiBinder Demo Code.See the
getSource()
function on line 58. He's using a SafeHtml object to build a nicely formatted XML output. At some point I believe you'll have to wrap this in ag:HTMLPanel
, or a regulardiv
.Hope that helps.
-tjw