How to mix HTML and GWT widgets using UIBinder?

We have an existing user interface 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 list.

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

If I try to use gwt: ValueListBox or gwt: ListBox there, I get an error that I cannot mix them. I also cannot have multiple children (e.g. div and HTMLPanel) under UIBinder.

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

+4
source share
2 answers

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

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

+12
source

Like this

 <gwt:HTMLPanel> <div align="center"> <gwt:VerticalPanel res:styleName="style.background"> 
0
source

All Articles