=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java 2014-03-18 08:10:10 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ShowDataElementFormAction.java 2014-07-07 02:47:35 +0000 @@ -65,138 +65,120 @@ // Dependencies // ------------------------------------------------------------------------- + public Map attributeValues = new HashMap(); private DataElementService dataElementService; + private DataElementCategoryService dataElementCategoryService; + private OrganisationUnitService organisationUnitService; + private AttributeService attributeService; + private OptionService optionService; + private MappingService mappingService; + private Integer id; + private DataElement dataElement; + private Collection dataElementGroups; + private List dataElementCategoryCombos; + private List organisationUnitLevels; + + // ------------------------------------------------------------------------- + // Input/output + // ------------------------------------------------------------------------- + private List aggregationLevels = new ArrayList(); + private DataElementCategoryCombo defaultCategoryCombo; + private List groupSets; + private List attributes; + private List optionSets; + private List legendSets; + private boolean update; public void setDataElementService( DataElementService dataElementService ) { this.dataElementService = dataElementService; } - private DataElementCategoryService dataElementCategoryService; - public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) { this.dataElementCategoryService = dataElementCategoryService; } - private OrganisationUnitService organisationUnitService; - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) { this.organisationUnitService = organisationUnitService; } - private AttributeService attributeService; - public void setAttributeService( AttributeService attributeService ) { this.attributeService = attributeService; } - private OptionService optionService; - public void setOptionService( OptionService optionService ) { this.optionService = optionService; } - private MappingService mappingService; - public void setMappingService( MappingService mappingService ) { this.mappingService = mappingService; } - // ------------------------------------------------------------------------- - // Input/output - // ------------------------------------------------------------------------- - - private Integer id; - public void setId( Integer id ) { this.id = id; } - private DataElement dataElement; - public DataElement getDataElement() { return dataElement; } - private Collection dataElementGroups; - public Collection getDataElementGroups() { return dataElementGroups; } - private List dataElementCategoryCombos; - public List getDataElementCategoryCombos() { return dataElementCategoryCombos; } - private List organisationUnitLevels; - public List getOrganisationUnitLevels() { return organisationUnitLevels; } - private List aggregationLevels = new ArrayList(); - public List getAggregationLevels() { return aggregationLevels; } - private DataElementCategoryCombo defaultCategoryCombo; - public DataElementCategoryCombo getDefaultCategoryCombo() { return defaultCategoryCombo; } - private List groupSets; - public List getGroupSets() { return groupSets; } - private List attributes; - public List getAttributes() { return attributes; } - public Map attributeValues = new HashMap(); - public Map getAttributeValues() { return attributeValues; } - private List optionSets; - public List getOptionSets() { return optionSets; } - private List legendSets; - public List getLegendSets() { return legendSets; } - private boolean update; - public boolean isUpdate() { return update; @@ -235,6 +217,11 @@ attributeValues = AttributeUtils.getAttributeValueMap( dataElement.getAttributeValues() ); } + else + { + dataElement = new DataElement(); + dataElement.setCategoryCombo( defaultCategoryCombo ); + } organisationUnitLevels = new ArrayList( levelMap.values() ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm 2014-06-26 09:29:30 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm 2014-07-07 02:47:35 +0000 @@ -97,11 +97,7 @@ - #if( $update ) - - #else - - #end + 0 && $!dataElement.type != 'int' ) style="display:none" #end>