How do you use GWT UiBinder XML? Can you avoid this?

In my markup, I want to add space (& nbsp;) between the elements, without having to use CSS. If I put & nbsp; in my markup, GWT is causing errors. Is there any way around this?

For instance:

<g:Label>One&nbsp;</g:Label><g:Label>Two</g:Label> 

Must show:

 One Two 

And not:

 OneTwo 
+6
source share
2 answers

As described in here , you just need to add this to the top of your XML file and it will work!

 <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> 

Note that the GWT compiler does not actually visit this URL to retrieve the file because a copy of it is baked into the compiler. However, your IDE can get it.

+14
source

Instead of using a shortcut, which for me should not contain symbolic entities at all, I use an HTML widget. However, in order to set the content, I believe that I should do this as an HTML attribute, not body content (note that there is important HTML code here, since the installed method is set to HTML, not setHtml)

 <g:HTML HTML="One&amp;nbsp;" /> 
0
source

Source: https://habr.com/ru/post/954111/


All Articles