smartgwt – 100% width for FormItem in a DynamicForm

I can’t belive I fell into this trap +10 years later, I was adding a filter -composed by a DynamicForm and a SelectItem- into and old legacy web application developed with SmartGwt. I just added a DynamicForm with a SelectItem with setTitleOrientation(TitleOrientation.TOP); into a VLayout and set the width of the SelectItem to setWidth("100%") which didn’t work, then read the docs and changed it to setWidth("*"), again didn’t work.

I found this post which referenced the proper documentation about FormLayout which reminded me that DynamicForms use a two column mode by default (one for the title ad one for the input control).

So, the solution is very simple, just setColSpan(2); 🤷

Deja un comentario