[Fusionforge-commits] r13227 - trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm

Sabri LABBENE labbenes at fusionforge.org
Thu Apr 28 20:35:32 CEST 2011


Author: labbenes
Date: 2011-04-28 20:35:31 +0200 (Thu, 28 Apr 2011)
New Revision: 13227

Modified:
   trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/show-creation-ui.phtml
Log:
Fix Ajax requests for OSLC delegated creation UI.

Modified: trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/show-creation-ui.phtml
===================================================================
--- trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/show-creation-ui.phtml	2011-04-28 18:00:55 UTC (rev 13226)
+++ trunk/src/plugins/oslc/include/oslc-zend/application/views/scripts/fusionforgecm/show-creation-ui.phtml	2011-04-28 18:35:31 UTC (rev 13227)
@@ -68,6 +68,7 @@
 			type: "POST",
 			url: URL,
 			data: jQuery.toJSON(postdata),
+			dataType: 'json',
 			beforeSend: function(xhr) {
 				xhr.setRequestHeader("Content-Type","application/x-oslc-cm-change-request+json");
 			},
@@ -76,24 +77,25 @@
 				result = data;
 				refresh();
 			},
-			error: function(err, ioargs) {
-               	var response = jQuery.parseJSON(ioargs.xhr.responseText);
+			error: function(jqXHR, textStatus, errorThrown) {
+				//alert(textStatus+' x '+jqXHR.responseText);
+               	var response = jQuery.parseJSON(jqXHR.responseText);
                	var errmsg, errcode;
                	for (var key in response) {
-						var obj = response[key];						   
-						if(key=="oslc_cm:Error")   {
-						   for (var i in obj) {
-							  if(i=="oslc_cm:statusCode")	{
-								  errcode = obj[i];
-							  }else if(i=="oslc_cm:message")	{
-								  errmsg = obj[i];
-							  } 
-						   }
-						   var errtext = "Error " + errcode + ": " + errmsg;
-						   alert(errtext);
-					   }
+					var obj = response[key];						   
+					if(key=="oslc_cm:Error") {
+						for (var i in obj) {
+							if(i=="oslc_cm:statusCode")	{
+								errcode = obj[i];
+							}else if(i=="oslc_cm:message") {
+								errmsg = obj[i];
+							}
+						}
+						var errtext = "Error " + errcode + ": " + errmsg;
+						alert(errtext);
 					}
 				}
+			}
 		});
 	});
 
@@ -120,8 +122,8 @@
 				//alert(datatosend);
 				respondWithPostMessage(datatosend);
 			},
-			error: function(err, ioargs) {
-               	var response = jQuery.parseJSON(ioargs.xhr.responseText);
+			error: function(jqXHR, textStatus, errorThrown) {
+               	var response = jQuery.parseJSON(jqXHR.responseText);
                	var errmsg, errcode;
 				for (var key in response) {
 						var obj = response[key];						   




More information about the Fusionforge-commits mailing list