=== 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 2011-05-11 21:14:38 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-05-12 09:25:07 +0000 @@ -274,7 +274,14 @@ if ( dataElement == null ) { - return "Data element with id :" + dataElementId + " does not exist in this data set"; + return "Data element with id : " + dataElementId + " does not exist"; + } + + DataElementCategoryOptionCombo categoryOptionCombo = categoryService.getDataElementCategoryOptionCombo( optionComboId ); + + if ( categoryOptionCombo == null ) + { + return "Category option combo with id: " + optionComboId + " does not exist"; } String dataElementValueType = dataElement.getType(); @@ -312,18 +319,11 @@ inputHtml = inputHtml.replaceAll( "view=\".*?\"", "" ); // For backwards compatibility - StringBuilder title = new StringBuilder( "title=\"Name: " ).append( dataElement.getName() ). - append( " Type: " ).append( dataElement.getType() ).append( " Min: " ).append( minValue ). - append( " Max: " ).append( maxValue ).append( "\"" ); + StringBuilder title = new StringBuilder( "title=\"Name: " ).append( dataElement.getName() ).append( " " ). + append( categoryOptionCombo.getName() ).append( " Type: " ).append( dataElement.getType() ). + append( " Min: " ).append( minValue ).append( " Max: " ).append( maxValue ).append( "\"" ); - if ( inputHtml.contains( EMPTY_TITLE_TAG ) ) - { - inputHtml = inputHtml.replace( EMPTY_TITLE_TAG, title ); - } - else - { - inputHtml += " " + title; - } + inputHtml = inputHtml.contains( EMPTY_TITLE_TAG ) ? inputHtml.replace( EMPTY_TITLE_TAG, title ) : inputHtml + " " + title; // ------------------------------------------------------------- // Append Javascript code and meta data (type/min/max) for