Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

gwt

uibinder

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>

like image 222
arinte Avatar asked Apr 30 '10 14:04

arinte


1 Answers

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.

like image 190
aem Avatar answered Nov 07 '22 02:11

aem