I have a list that I would like to sort on a Checkbox column (Datatype = Bit). If I Sort on this Checkbox column by selecting Sort in the Software Factory and give it the Sort order: Ascending, I would expect it to work like that the value 0 comes before the value 1.
But what I noticed is that it works the other way round; Ascending works like the checked rows come before the unchecked rows and Descending works like the unchecked rows come before the checked rows.
Has this been a conscious decision or does this indeed work the wrong way?
Solved
Sorting on Checkbox(bit) works differently than I expect
Best answer by Vincent Doppenberg
Hi Mark,
Domains with checkbox controls are often configured to have elements, much like domains with combo controls. When sorting a column that has a domain with elements, the GUI will sort the column by the display value that corresponds with the database value (in your case, "Ja" comes before "Nee"). If you open the debug window in the Windows GUI, you will probably see a case statement in the order by clause that explains the order of the results.
Since this means that the result of a sort action depends on the language of the user, there have been wishes to change this behaviour to using the order_no of the element, rather than its display value. This is actually what Indicium does right now. However, we probably want to be able to support both ways, because you'd definitely want a list of countries for instance to be ordered alphabetically by their display value, it's very situational.
I hope that explains the behaviour. We're working on giving developers more control over it.
View originalDomains with checkbox controls are often configured to have elements, much like domains with combo controls. When sorting a column that has a domain with elements, the GUI will sort the column by the display value that corresponds with the database value (in your case, "Ja" comes before "Nee"). If you open the debug window in the Windows GUI, you will probably see a case statement in the order by clause that explains the order of the results.
Since this means that the result of a sort action depends on the language of the user, there have been wishes to change this behaviour to using the order_no of the element, rather than its display value. This is actually what Indicium does right now. However, we probably want to be able to support both ways, because you'd definitely want a list of countries for instance to be ordered alphabetically by their display value, it's very situational.
I hope that explains the behaviour. We're working on giving developers more control over it.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.