Hello Isomorphic,
We are using Smart Client v8.3p_2013-07-18/Pro Deployment. We have a data source that has a field 'aStatusField' of type enum. This field is an editable field in the ListGrid that displays a drop-down with the enum values from our Java enum com.mycompany.StatusEnum. The code for StatusEnum is copied below too. I wanted to populate the status column drop-down values in the order they are defined in the enum - "Unresolved," "In Progress," and "Resolved." However, they get listed in the order "Resolved," "Unresolved," "In Progress." Why do they get listed this way? Is there a way to define the order they are listed in the drop-down?
Thanks.
We are using Smart Client v8.3p_2013-07-18/Pro Deployment. We have a data source that has a field 'aStatusField' of type enum. This field is an editable field in the ListGrid that displays a drop-down with the enum values from our Java enum com.mycompany.StatusEnum. The code for StatusEnum is copied below too. I wanted to populate the status column drop-down values in the order they are defined in the enum - "Unresolved," "In Progress," and "Resolved." However, they get listed in the order "Resolved," "Unresolved," "In Progress." Why do they get listed this way? Is there a way to define the order they are listed in the drop-down?
Thanks.
Code:
<DataSource ID="MyPageDS" serverConstructor="spring:myPageDataSource" schemaBean="com.mycompany.MyPage" validateRelatedRecords="true"> <fields> <field primaryKey="true" name="id" title="ID" type="sequence" /> <field name="additionalCriteria1Id" type="integer" /> <field name="additionalCriteria2Id" type="integer" /> <field name="additionalCriteria3Id" type="integer" /> <field name="additionalCriteria4Id" type="integer" /> <field name="aTextField" type="text" /> <field name="aDateField" type="datetime" /> <field name="anotherTextField" type="text" /> <field name="aStatusField" type="enum" valueMapEnum="com.mycompany.StatusEnum" /> <field name="mostRecentNote" type="MyPageNotesDS" /> <field name="comments" type="any" /> </fields> </DataSource>
Code:
public enum StatusEnum { Unresolved("Unresolved", 1), InProgress("In Progress", 2), Resolved("Resolved", 3); private String value; private int order; private StatusEnum(final String value, final int order) { this.value = value; this.order = order; } public int toInt() { return order; } }
Comment