What is the correct way to make form fields 100% width of the container there in ?
I currently use a utility method to make all the form items full width...
Which gives me something like this...
The issue comes when I use form.setWrapItemTitles(true)
So without this set I might have something like this...
With it set this Happens...
So it seems the form fields get a maximum with based on the width available when the labels are not wrapped, but with the wrapping, the label columns width are extended and that causes horizontal scrollbars to appear which I don;t want, makes the form look very untidy.
I hope I've explained this well enough with those text drawings. So what is the correct way to do this? setWidth to "100%" or "*" seem to give the same behavior, there's no setWidth100() for FormItems, how is this to be achieved?
Thanks,
Dale
I currently use a utility method to make all the form items full width...
Code:
public static void setFieldWidths(DynamicForm form) { for (FormItem formItem : form.getFields()) { if (!(formItem instanceof ButtonItem)) { try { formItem.setWidth("100%"); } catch (Exception ex) { //NOSONAR //Do Nothing on client } } } }
Code:
v---- Edge of the page +--------------------------------------+ | Label |{========================]| +--------------------------------------+ | Label |{========================]| +--------------------------------------+
So without this set I might have something like this...
Code:
v---- Edge of the page +--------------------------------------+ | Very Long | | | Label |{========================]| +--------------------------------------+ | Label |{========================]| +--------------------------------------+
Code:
v---- Edge of the page +--------------------------------------------+ | Very Long Label |{========================]| +--------------------------------------------+ | Label |{========================]| +--------------------------------------------+
I hope I've explained this well enough with those text drawings. So what is the correct way to do this? setWidth to "100%" or "*" seem to give the same behavior, there's no setWidth100() for FormItems, how is this to be achieved?
Thanks,
Dale
Comment