GXT 3.x only.
Let us say I wish to create a gxt field-pair of the layout
label: value
For example,
Name: Carthyguessue
Where "Carthyguessue" is a constant field not updateable by user, which I effect with using a gwt:Label.
Hence the ui template:
<form:FieldLabel ui:field="nameLabel" text="Name" labelWordWrap="false">
<form:widget>
<g:Label ui:field="nameValue" />
</form:widget>
</form:FieldLabel>
However, as everyone having done this realises that there would be a deficit of ~3px between the vertical offsets of nameLabel and nameValue.
One suggested approach was to hijack the gwt-Label css to define the offset. However, what if I cannot do that because CSS is totally done by another dept.
Hence, I found this to work.
<form:FieldLabel text="Name" labelWordWrap="false">
<form:widget>
<container:VerticalLayoutContainer>
<g:Label height="3px"/>
<g:Label ui:field="nameValue" />
</container:VerticalLayoutContainer>
</form:widget>
</form:FieldLabel>
My question:
- What problems/issues would I face with this approach? (which I have yet to be aware of).
- Is there a better non-css solution?
- Ok, less importantly, why gxt folks wouldn't provide a matching Label widget (Without annoying boundaries simulated by disabled greyed-out text field), in that we still have to use gwt:Label for this purpose?