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

I get this error when I run the Gwt application

Widget found in HTML context

Here is the xml snippet he 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> 

+6
gwt uibinder
source share
1 answer

There are certain tags (those that GWT says create an "HTML context") that cannot have widgets inside them. For example, <g:HTML><g:Label /></g:HTML> is illegal because only HTML elements are expected, not widgets. However, if you change this to <g:HTMLPanel><g:Label /></g:HTMLPanel> , it will work.

The specific piece of code causing the error in your code is <g:ListBox ui:field='deletedigs' class="dropdownbx" name='deleteDigits'/> , which is contained in <g:HTML ui:field="localPanel"> . Make <g:HTML> in <g:HTMLPanel> and everything should work.

+12
source share

All Articles