What is this error Found widget <g:ListBox class='dropdownbx' name='deleteDigits' ui:field='deletedigs'> in an HTML context
Asked Answered
B

1

6

I get this error when I run my Gwt app

Found widget in an HTML context

Here is a snippet of the xml that it complains about:

    <!-- ... -->
    <g:HTML ui:field="localPanel">

    <fieldset>
        <legend>Local</legend>
        <label for="btn" >BTN:</label><input type="text" ui:field="btn" class="txtbx numeric" maxlength="10" name='btn'/>
        <label for="stdprt">SDT PRT:</label><input type="text" ui:field="stdprt" class="txtbx" readonly="readonly" name='stdPrt'/>
        <label for="rateArea">Rate Area:</label><input type="text" ui:field="ratearea" class="txtbx" readonly="readonly" name='rateArea'/>
        <br/>
        <label for="deleteDigits">Delete Digits:</label><g:ListBox ui:field='deletedigs' class="dropdownbx" name='deleteDigits'/>
    </fieldset>
    </g:HTML>
    <g:Button ui:field="submit2">Submit</g:Button>
    </g:HTMLPanel>

Bedstead answered 30/4, 2010 at 14:34 Comment(0)
F
12

There are certain tags (those which GWT says are make an "HTML context") that can't have widgets inside them. For instance, <g:HTML><g:Label /></g:HTML> is illegal because a only expects HTML elements and not widgets. However, if you change that to <g:HTMLPanel><g:Label /></g:HTMLPanel> it will work.

The particular snippet triggering the error in your code is the <g:ListBox ui:field='deletedigs' class="dropdownbx" name='deleteDigits'/> that's contained in the <g:HTML ui:field="localPanel">. Make that <g:HTML> into a <g:HTMLPanel> and it should all work.

Franctireur answered 30/4, 2010 at 14:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.