You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ad...@apache.org on 2013/05/31 16:10:17 UTC
svn commit: r1488240 -
/ofbiz/trunk/framework/images/webapp/images/selectall.js
Author: adrianc
Date: Fri May 31 14:10:17 2013
New Revision: 1488240
URL: http://svn.apache.org/r1488240
Log:
Small improvement to the Ajax JS functions - allow a complete screen refresh if the specified area ID equals "window". This is helpful for form widgets that have certain events that require a screen update instead of a container update.
Modified:
ofbiz/trunk/framework/images/webapp/images/selectall.js
Modified: ofbiz/trunk/framework/images/webapp/images/selectall.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/selectall.js?rev=1488240&r1=1488239&r2=1488240&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/selectall.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/selectall.js Fri May 31 14:10:17 2013
@@ -240,6 +240,11 @@ function confirmActionFormLink(msg, form
*/
function ajaxUpdateArea(areaId, target, targetParams) {
+ if (areaId == "window") {
+ targetUrl = target + "?" + targetParams.replace('?','');
+ window.location.assign(targetUrl);
+ return;
+ }
waitSpinnerShow();
jQuery.ajax({
url: target,
@@ -258,28 +263,17 @@ function ajaxUpdateArea(areaId, target,
* form of: areaId, target, target parameters [, areaId, target, target parameters...].
*/
function ajaxUpdateAreas(areaCsvString) {
- waitSpinnerShow();
var areaArray = areaCsvString.split(",");
var numAreas = parseInt(areaArray.length / 3);
for (var i = 0; i < numAreas * 3; i = i + 3) {
var areaId = areaArray[i];
var target = areaArray[i + 1];
var targetParams = areaArray[i + 2];
- // that was done by the prototype updater internally, remove the ? and the anchor flag from the parameters
+ // Remove the ? and the anchor flag from the parameters
// not nice but works
targetParams = targetParams.replace('#','');
targetParams = targetParams.replace('?','');
- jQuery.ajax({
- url: target,
- async: false,
- type: "POST",
- data: targetParams,
- success: function(data) {
- jQuery("#" + areaId).html(data);
- waitSpinnerHide();
- },
- error: function(data) {waitSpinnerHide()}
- });
+ ajaxUpdateArea(areaId, target, targetParams);
}
}