If you have a gwt widget that is set to a percentage, since the widget has no set px size and there's auto generated intermediary divs above that have no size indicated, the widget doesn't display(size:0px).
The html you end up with is like this:
The important part is right here:
The second div is stock generated in a getInnerHTML call in WidgetCanvas and sets the width and height to 100%. But that doesn't really matter because the first div, which can't be accessed directly in the SmartGWT api, has no size.
It looks like setting percentages through the smartgwt api normally turns everything into actual px measurements, so the sizeless divs don't matter in normal smartgwt code, but if actual percentages are used in non smartgwt code, it fails.
Even if the intermediate divs had 100% size, this would still give the wrong percentage, as the 50% is being added twice, once in the actual smartgwt widget, and a second time when the widget canvas is set to 50% of it's parent (where the percent turned into an actual px measurement), so the widget actually ends up at 25% size.
The html you end up with is like this:
Code:
<div id="isc_D6" class="normal" onscroll="return isc_SGFusionWidget_0.$lh()" style="position: absolute; left: 0px; top: 0px; width: 350px; height: 450px; z-index: 203168; -moz-box-sizing: border-box; overflow: hidden; cursor: default;" eventproxy="isc_SGFusionWidget_0"> <div id="isc_D7" style="POSITION:relative;VISIBILITY:inherit;Z-INDEX:203168;CURSOR:default;" eventproxy="isc_SGFusionWidget_0"> <div id="isc_D8" class="hokeyZ" onscroll="return isc_WidgetCanvas_4.$lh()" style="position: absolute; left: 0px; top: 0px; width: 175px; height: 225px; z-index: 203186; -moz-box-sizing: border-box; overflow: hidden; cursor: default;" eventproxy="isc_WidgetCanvas_4"> <div id="isc_D9" style="position: relative; visibility: inherit; z-index: 203186; cursor: default;" eventproxy="isc_WidgetCanvas_4"> <div id="isc_WidgetCanvas_4_widget" style="width:100%;height:100%"> <div id="0.28370684173338534" style="width: 50%; height: 50%;">
Code:
<div id="isc_D9" style="position: relative; visibility: inherit; z-index: 203186; cursor: default;" eventproxy="isc_WidgetCanvas_4"> <div id="isc_WidgetCanvas_4_widget" style="width:100%;height:100%">
It looks like setting percentages through the smartgwt api normally turns everything into actual px measurements, so the sizeless divs don't matter in normal smartgwt code, but if actual percentages are used in non smartgwt code, it fails.
Even if the intermediate divs had 100% size, this would still give the wrong percentage, as the 50% is being added twice, once in the actual smartgwt widget, and a second time when the widget canvas is set to 50% of it's parent (where the percent turned into an actual px measurement), so the widget actually ends up at 25% size.
Comment