In a field group, I can easily set a field mask on a particular field to act as an input and formatting mask (e.g. for a north american telephone number I enter ###-###-####).
For a GUI table such as is used in browser screens or master/detail views, there is no mask property on columns. Instead there is a formatter property which is supposed to allow me (I think) to specify a class that implements com.haulmont.cuba.gui.components.Formatter.
My problem is that I can’t find a list of classes that implement com.haulmont.cuba.gui.components.Formatter, or ways to specify a mask similar to what I do for fields in a field group.
Moreover, it seems inconsistent that there are these two different approaches for formatting field data. Why not just have a mask attribute on a table’s column just like there is in a field group?
You are right that specifying a mask right on the column would be more convenient, especially if the table is editable. Or better the mask should be on the entity attribute itself, to save from scattering the mask through the UI code. We’ll consider this requirement after implementing this feature: https://youtrack.cuba-platform.com/issue/PL-8123
No, at this point I’m just trying to get the read-only table for the browser screen to format the same way as the read/write fields in the edit screen.
Ideally sure it would be nice to be able to enable in place editing in the browser view as well - but that’s not my problem right now and in any case, unless I’ve missed something that base behaviour of in-place editing doesn’t seem to be supported in the standard screen generation.
What about the numeric entity atributes (int, long, double, decimal)?
They are mapped to a single TextField. If I would like to apply a mask, for instance, in a currency field, what I do?
Should I create a special implementation with addCustomField() together with the custom=“true” attribute of the field element? What about the conversion from the text presentation form (front end) to numeric field value (back end)?