← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2253: Fix bug: Error when updating the name of dataentryform.

 

------------------------------------------------------------
revno: 2253
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2010-12-02 16:06:35 +0700
message:
  Fix bug: Error when updating the name of dataentryform.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm


--
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-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm	2010-10-28 09:17:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/viewDataEntryForm.vm	2010-12-02 09:06:35 +0000
@@ -1,9 +1,9 @@
 <script type="text/javascript">
-    var stat = '$status';
+    var stat = ('$!dataEntryForm') ? "EDIT" : "ADD";
     var dataEntryFormId = -1;
     var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "dataentryform_confirm_delete" ) , "'" )';
     	
-    #if($status == "EDIT")
+    #if($!dataEntryForm)
         dataEntryFormId = $dataEntryForm.id;
     #end    
   
@@ -91,7 +91,7 @@
     <tbody>
       <tr>
         <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
-        <td><input type="text" id="nameField" name="nameField" value='#if($status == "EDIT") $dataEntryForm.name #end' style="width:20em" maxlength="100" class="{validate:{required:true,minlength:4}}"/></td>
+        <td><input type="text" id="nameField" name="nameField" value='$!dataEntryForm.name' style="width:20em" maxlength="100" class="{validate:{required:true,minlength:4}}"/></td>
       </tr>
       <tr>
         <td><label>$i18n.getString( "dataset" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>