rem: sendPage("redirect.html", { "url" : redirectUri }); 
add: cocoon.redirectTo(redirectUri); 
context: function iprangeChangeGroups() {	var redirectUri = getRequestUri();	var iprangeId = getAccreditableId();    var range = getAccreditableManager().getIPRangeManager().getIPRange(iprangeId);        var rangeGroupArray = range.getGroups();    var rangeGroups = new java.util.ArrayList(java.util.Arrays.asList(rangeGroupArray));        var groupArray = getAccreditableManager().getGroupManager().getGroups();    var groups = new java.util.ArrayList();    for (var i = 0; i < groupArray.length; i++) {    	if (!rangeGroups.contains(groupArray[i])) {    		groups.add(groupArray[i]);    	}    }        while (true) {	    cocoon.sendPageAndWait("ipranges/" + iprangeId + "/groups.xml", {	    	"iprange-id" : iprangeId,	    	"groups" : groups,	    	"iprange-groups" : rangeGroups	    });	    		var groupId = cocoon.request.get("group");		if (cocoon.request.get("add_group") && groupId != "") {			var group = getAccreditableManager().getGroupManager().getGroup(groupId);			if (!rangeGroups.contains(group)) {				rangeGroups.add(group);				groups.remove(group);			}		}	    		var rangeGroupId = cocoon.request.get("iprange_group");		if (cocoon.request.get("remove_group") && rangeGroupId != "") {			var group = getAccreditableManager().getGroupManager().getGroup(rangeGroupId);			if (rangeGroups.contains(group)) {				rangeGroups.remove(group);				groups.add(group);			}		}	    if (cocoon.request.get("cancel")) {	    	break;	    }	    		if (cocoon.request.get("submit")) {			range.removeFromAllGroups();			var iterator = rangeGroups.iterator();			while (iterator.hasNext()) {				var group = iterator.next();				group.add(range);			}			range.save();			break;		}	}   	sendPage("redirect.html", { "url" : redirectUri });}
meta: 791	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/791/5b9c6ae2fb641effa76e35efe68abb2bee660da7/iprange-admin.js/buggy/src/webapp/lenya/content/admin/ipranges/iprange-admin.js