如何使用UIBinder混合使用HTML和GWT小部件? [英] How to mix HTML and GWT widgets using UIBinder?

查看:91
本文介绍了如何使用UIBinder混合使用HTML和GWT小部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用UIBinder构建的现有UI,它的ui.xml文件包含以下层次结构:

 < ui:UiBinder> ; 
< div>
多个< span>或< a>由逐字HTML分隔(如|分隔符)。

我需要用一个列表框替换其中一个锚。



有没有办法在不用HTMLPanel替换div的情况下进行此转换,并将所有锚都更改为其他内容?

如果我尝试在其中粘贴一个gwt:ValueListBox或gwt:ListBox,我会收到一条错误消息,说明我无法混合这两者。我也不能在UIBinder下面有多个孩子(比如一个div和一个HTMLPanel)。



如果我唯一的选择是将所有东西都转换成小部件,那么适当的转换是什么for和items?

解决方案

在UIBinder中, HTMLPanel 和GWT小部件,但HTML元素只能包含其他HTML元素。



只需将顶级 div 替换为 HTMLPanel ,然后将< a> c $ c>。


We have an existing UI built with UIBinder whose ui.xml file contains the following hierarchy:

<ui:UiBinder>
<div>
Multiple <span> or <a> separated by verbatim HTML (like | separators).

I need to replace one of the anchors with a listbox.

Is there a way to make this transition without replacing the div with an HTMLPanel and changing all the anchors to something else?

If I try to stick a gwt:ValueListBox or gwt:ListBox in there, I get an error message that I cannot mix the two. I also cannot have multiple children (such as a div and an HTMLPanel) under the UIBinder.

If my only option is to convert everything to widgets, what are the appropriate conversions for and items?

解决方案

In UIBinder, HTMLPanel can contain HTML elements and GWT widgets, but HTML elements can only contain other HTML elements.

Just replace top-level div with HTMLPanel, then replace only a specific <a> anchor with gwt:ListBox.

这篇关于如何使用UIBinder混合使用HTML和GWT小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆