=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2013-10-08 13:00:44 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2013-10-08 14:12:39 +0000 @@ -411,6 +411,11 @@ { return url != null && !url.trim().isEmpty(); } + + public boolean hasOptionSet() + { + return optionSet != null; + } // ------------------------------------------------------------------------- // Getters and setters === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2013-09-23 09:50:17 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2013-10-08 14:12:39 +0000 @@ -52,6 +52,8 @@ import org.hisp.dhis.system.util.FilterUtils; import org.springframework.transaction.annotation.Transactional; +import static org.hisp.dhis.dataelement.DataElement.*; + /** * @author Bharath Kumar * @version $Id$ @@ -297,7 +299,7 @@ String appendCode = ""; - if ( dataElement.getType().equals( DataElement.VALUE_TYPE_BOOL ) ) + if ( VALUE_TYPE_BOOL.equals( dataElement.getType() ) ) { inputHtml = inputHtml.replace( "input", "select" ); inputHtml = inputHtml.replaceAll( "value=\".*?\"", "" ); @@ -309,11 +311,11 @@ appendCode += ""; appendCode += ""; } - else if ( dataElement.getType().equals( DataElement.VALUE_TYPE_TRUE_ONLY ) ) + else if ( VALUE_TYPE_TRUE_ONLY.equals( dataElement.getType() ) ) { appendCode += " name=\"entrytrueonly\" class=\"entrytrueonly\" type=\"checkbox\" tabindex=\"" + i++ + "\"" + TAG_CLOSE; } - else if ( dataElement.getOptionSet() != null ) + else if ( dataElement.hasOptionSet() ) { appendCode += " name=\"entryoptionset\" class=\"entryoptionset\" tabindex=\"" + i++ + "\"" + TAG_CLOSE; }