We have noticed the sort order of the values in the search conditions that appear as drop downs in the filter control don’t seem to be consistent. Is there a way to control the ordering of the available values in these drop downs?
There is no way do declare a sort order for dropdown lists of entities in generic filter.
Maybe one of the following options may be useful for you:
Use the pickerField instead of the dropdown list. You can define that a pickerField should be used by the @Lookup annotation on the attribute in the entity class.
You can always add a set of UI components to the screen. These components may be used for filtering a table instead of generic filter. See the example in the DataLoadCoordinator documentation.
Hi @Corey.Amoruso and @gorbunkov,
Sorry for “resurrecting” this topic, but I had the same need reported by @Corey.Amoruso and I came up with a solution that may be useful to others as well.
What I have implemented is not exactly be able to define an order for the generic filters dropdown, but instead sort entities by the InstanceName by default. For our need, this solution fitted perfectly. The following steps where needed to implement this behavior:
After these changes, whenever a dropdown is shown in the generic filter for an Entity implementing InstanceName, it will be sorted in a consistent way. I don’t know if there is any additional side effects not correctly handled in this extension, but I’ve had no problem so far.
P.S.: The second part of the implementation commented in the class (sort by a parameter implementing Instance name) may not be required. I needed to implement it because we developed a custom translation component that has an Entity that is not being sort at database level.
Would you be able to re-share your solution for the ExtDataManagerClientImpl.java as we have the same requirements and would be really interested to see how you did it. Unfortunately the link to the code is no longer working.