← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17574: SQL view, using post for validation since the actual sql query is part of the request

 

------------------------------------------------------------
revno: 17574
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-11-24 20:09:53 +0100
message:
  SQL view, using post for validation since the actual sql query is part of the request
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js


--
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-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js	2014-11-01 21:22:12 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/javascript/sqlView.js	2014-11-24 19:09:53 +0000
@@ -4,14 +4,16 @@
   var name = $("#name").val();
   var sqlquery = $("#sqlquery").val();
 
-  $.getJSON(
-    "validateAddUpdateSqlView.action",
-    {
+  $.ajax( {
+    url: "validateAddUpdateSqlView.action",
+    type: "post",
+    data: {
       "name": name,
       "sqlquery": sqlquery,
       "mode": mode
     },
-    function( json ) {
+    dataType: "json",
+    success: function( json ) {
       if( json.response == "success" ) {
         if( mode == "add" ) {
           byId("addSqlViewForm").submit();
@@ -23,7 +25,7 @@
         setHeaderDelayMessage(json.message);
       }
     }
-  );
+  } );
 }
 
 function removeSqlViewObject( context ) {