Sort column by generated component

I generated a TextField to update my row order with a valuechange listener. works great but when I want to sort when clicking the column it doesent sort. I guess it sees the component and not a value and does nothing. How can I solve this issue? Thank you.

You can to Entity add Transient attribute with Sting type.

...
    @JmixProperty
    @Transient
    private String calcField;
...

It is not stored in the database, but sorting in the table column will work for it.

1 Like

thank you for the response
I want the “order” field to be persisted on the database. I want to edit it and after edit… to immediately be stored on the database. This works by generating a column putting a value source and an event on change to update the db.

what doesn’t work is that I cannot sort by the generated column

Apparently I don’t fully understand what scenario you need to implement.
A code snippet or test project would make it easier to understand the situation.

But the point is that it is impossible to sort by the generated column if it is somehow not related to the entity field.

This has been discussed more than once on the Cuba forum and in JMIX the principle has not changed.
For example, this topic Sorting generated columns - CUBA.Platform (cuba-platform.com)

1 Like

TextField textField = uiComponents.create(TextField.TYPE_INTEGER);
specifing the type seems like it fixed the issue.