Hi.
I’m having troubles trying to set witdh to a TextField inside a HorizontalLayout.
The code:
public class TStringField extends HorizontalLayout {
...
TextField text = new TextField();
addComponent(text);
this.setWidth("250px");
text.setWidth("250px");
}
Inspecting the resulting page, I get this:
[b]
<div class="v-horizontallayout" style="overflow: hidden; width: 250px; height: 24px;"><div style="overflow: hidden; margin: 0px; width: 250px; height: 24px;"><div style="height: 24px; width: 248px; overflow: hidden; float: left; padding-left: 0px; padding-top: 0px;"><div style="float: left; margin-left: 0px;"><input type="text" class="v-textfield" maxlength="200" style="width: 20em;"></div></div><div style="height: 24px; width: 2px; overflow: hidden; float: left; padding-left: 0px; padding-top: 0px;"><div style="float: left; margin-left: 0px;"><div class="v-label" style="width: 2px;"></div></div></div><div style="width: 0px; height: 0px; clear: both; overflow: hidden;"></div></div></div>
[/b]
<div style="overflow: hidden; margin: 0px; width: 250px; height: 24px;"><div style="height: 24px; width: 248px; overflow: hidden; float: left; padding-left: 0px; padding-top: 0px;"><div style="float: left; margin-left: 0px;"><input type="text" class="v-textfield" maxlength="200" style="width: 20em;"></div></div><div style="height: 24px; width: 2px; overflow: hidden; float: left; padding-left: 0px; padding-top: 0px;"><div style="float: left; margin-left: 0px;"><div class="v-label" style="width: 2px;"></div></div></div><div style="width: 0px; height: 0px; clear: both; overflow: hidden;"></div></div>
<div style="height: 24px; width: 248px; overflow: hidden; float: left; padding-left: 0px; padding-top: 0px;"><div style="float: left; margin-left: 0px;"><input type="text" class="v-textfield" maxlength="200" style="width: 20em;"></div></div>
<div style="float: left; margin-left: 0px;"><input type="text" class="v-textfield" maxlength="200" style="width: 20em;"></div>
[b]
<input type="text" class="v-textfield" maxlength="200" style="width: 20em;"
[/b]>
...
...
Why the
style=“width: 20em;”
remains in the last line? It should be
width: 250px
Thanks!