Is there any way I can control displaying the field label to the right, left or top of the field in the screen?
Standalone components, such as TextField or LookupField support only caption on the top of a field. You can change position of a caption only inside FieldGroup using setCaptionAlignment method or captionAlignment property from XML. By default FieldGroup shows caption on the left from a component.
If you need to show caption on the top for the standalone field then you can replace caption with separate Label component. Example:
<vbox> <label value="Test"/> <textField id="testField"/> </vbox>
The captionAlignment property of FieldGroup does work (tested OK in 6.4.1), but it seems to be completely undocumented at present - it is not mentioned in the CUBA Platform Developers Manual nor demonstrated in the CUBA UI Sampler application.
Thank you for pointing it out. We’ll certainly add it to the docs.
I didn’t find such options though, thanks for any sample code.
I didn’t fine any caption alignment property. Only found captionProperty and I tried as follows but no good result:
<field id="lcOpened" caption="L/C has been opened" captionProperty="MIDDLE_RIGHT" editable="false" ></field>
You should be able to use it like this:
<fieldGroup captionAlignment="LEFT" ...>
<fieldGroup captionAlignment="TOP" ...>
We’ll add it to the docs shortly.
Any chance of having this option added to the fieldgroup config gui in Studio?
Love that the option is there, so it would be great if it was just a toggle.
Thanks for reminding. Created an issue: https://youtrack.cuba-platform.com/issue/STUDIO-4249