dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16813
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6495: (local) Sorted data element list by formName and by name in data entry form.
------------------------------------------------------------
revno: 6495
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-04-06 10:23:01 +0700
message:
(local) Sorted data element list by formName and by name in data entry form.
modified:
local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java'
--- local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java 2012-03-30 04:49:55 +0000
+++ local/vn/dhis-service-vn/src/main/java/org/hisp/dhis/dataelement/DataElementFormNameComparator.java 2012-04-06 03:23:01 +0000
@@ -39,6 +39,9 @@
{
public int compare( DataElement dataElement0, DataElement dataElement1 )
{
- return dataElement0.getFormName().compareToIgnoreCase( dataElement1.getFormName() );
+ String name0 = ( dataElement0.getFormName() != null || !dataElement0.getFormName().isEmpty() ) ? dataElement0.getFormName() : dataElement0.getName();
+ String name1 = ( dataElement1.getFormName() != null || !dataElement1.getFormName().isEmpty() ) ? dataElement1.getFormName() : dataElement1.getName();
+
+ return name0.compareToIgnoreCase( name1 );
}
}