FieldGroup : be able to customize programmatically


Currently, it is not allowed to call FieldGroup.setCustom(true) or reassign the component programmatically through FieldGroup.setComponent().

The fact is we generate our forms semi-automatically depending on configuration, sometimes a component will be the default one yield by FieldGroup, sometimes we want to replace it.

Is there a way currently to do that ? Alternatively, assigning a custom ComponentsFactory to a given property inside a FieldGroup could do the trick.



At the moment you can easily remove field and insert a new one:


FieldGroup.FieldConfig positionField = fieldGroupLeft.createField("position");
fieldGroupLeft.addField(positionField, 0, 2);

We are planning to convert FieldGroup to something like simple container and get rid of separate FieldConfig objects, but it will be done only in the Major version 7+.

That’s good news Yuriy, is there any idea of date frame for 7.0 release ?

Since it is a Major release it will take a big amount of time. We will try to release beta version in the next June.

Understood, that’s big.

If you can make FieldGroup support:

  • row & col spanning
  • fitting a composition of components into a cell (*) each one linked to a DS property
  • changing field column or line by drag & drop
  • setting ‘custom’ programmatically
  • choose default tab ordering by column first or by line first (currently by column first only)
  • set empty cells as filler without using a custom component
  • set text alignement for text fields

Then you will have a powerhouse component that fits a very large range use cases.

(*) we have found a way to do it, but it is cumbersome because precisely, FieldGroup internal layout does not behave like GridLayout, it always allocates 100% space except if you expand components.