← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19549: ( Merged from R. 19255, version 2.19) Added border on period selection combo box. Changed page f...

 

------------------------------------------------------------
revno: 19549
committer: Tran Chau<tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-07-06 17:12:37 +0700
message:
  ( Merged from R. 19255, version 2.19) Added border on period selection combo box.  Changed page footer to include version.
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.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 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java	2015-07-06 10:12:37 +0000
@@ -670,25 +670,19 @@
     }
 
     private void addCell_WithDropDownListField( PdfPTable table, Rectangle rect, PdfWriter writer, PdfPCell cell, String strfldName, String[] optionList,
-        String[] valueList)
+        String[] valueList) throws IOException, DocumentException
     {
-        // If there is option, then create name-value set in 2 dimension array
-        // and set it as dropdown option name-value list.
-        String[][] optionValueList = new String[optionList.length][2];
-
-        for ( int i = 0; i < optionList.length; i++ )
-        {
-            optionValueList[i][1] = optionList[i];
-            optionValueList[i][0] = valueList[i];
-        }
-
-        // Code 2 create DROP-DOWN LIST
-        PdfFormField dropDown = PdfFormField.createCombo( writer, true, optionValueList, 0 );
-
-        dropDown.setWidget( new Rectangle(0, 0), PdfAnnotation.HIGHLIGHT_INVERT );
-        dropDown.setFieldName( strfldName );
-
-        dropDown.setMKBorderColor( Color.BLACK );
+        TextField textList = new TextField( writer, rect, strfldName );
+
+        textList.setChoices( optionList );
+        textList.setChoiceExports( valueList );
+
+        textList.setBorderWidth( 1 );
+        textList.setBorderColor( Color.BLACK );
+        textList.setBorderStyle( PdfBorderDictionary.STYLE_SOLID );
+        textList.setBackgroundColor( COLOR_BACKGROUDTEXTBOX );
+
+        PdfFormField dropDown = textList.getComboField();
 
         cell.setCellEvent( new PdfFieldCell( dropDown, rect.getWidth(), rect.getHeight(), writer ) );
 

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java	2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java	2015-07-06 10:12:37 +0000
@@ -100,7 +100,7 @@
 
     private static final String DATAVALUE_IMPORT_TIMESTAMP_DATEFORMAT = "yyyy-MM-dd";
 
-    private static final String FOOTERTEXT_DEFAULT = "PDF Template generated from DHIS %s on %s";
+    private static final String FOOTERTEXT_DEFAULT = "PDF Template [v 1.00] generated from DHIS %s on %s";
 
     private static final String DATEFORMAT_FOOTER_DEFAULT = "MMMM dd, yyyy";