Compile Error: Found widget in an HTML context Element

时光毁灭记忆、已成空白 提交于 2019-12-12 12:05:21

问题


I've seen this answer but my I can't see what could possibly be the problem in my own code. Here is the my uibinding xml:

<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:a='urn:import:com.google.gwt.app.client'>
    <ui:style field='iphone' src='Render.css' />        
<div id='iHeader'>
    <div
        style='display:block; opacity:1; -webkit-tranform:translate3d(0px, 0px, 0px);'>
        <a>
            <span id='waHeadTitle'
                style='display:block; -webkit-tranform:translate3d(0px, 0px, 0px);'>
                <g:HTML ui:field="title" />
            </span>
        </a>
    </div>
</div>
</ui:UiBinder>

Then I get the error message: Found widget in an HTML context Element <g:HTML ui:field='title'>


回答1:


The problem was that the root element of the widget was a div. I think that's fine as long as the whole widget is pure HTML, but if you want to mix HTML and widgets, the root has to be HTMLPanel.



来源:https://stackoverflow.com/questions/3418634/compile-error-found-widget-in-an-html-context-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!