Hello team,
I’m trying to just allow user enter only digits into an editable column. I know there’s a attribute ‘datatype’ for TextField. But I don’t know what to use in this case. Thanks.
Hi.
Use addGeneratedColumn()
method to define custom representation of data in a column. See the documentation for more information.
Regards,
Natalia
Thanks Natalia.
I know in Cuba we can use:
textField.setDatatype(Datatypes.get(Double.class));
But in jmix, Datatypes seems gone. Is there another way that I can archive the same thing as above line?
Hi,
Use io.jmix.core.metamodel.datatype.DatatypeRegistry
bean and its get()
method.
For example:
Datatype datatype = datatypeRegistry.get(BigDecimal.class);
1 Like