Below I have this method that makes an AJAX post to update a single record. I am trying to create a method that updates multiple records at once. So, it would be something like saveAllComments with a new param called groupIds...this will update the boxStatus for all records by groupId. In this case do I have to write a for loop to iterate over all of the records? If so how would one go about this? Is there an easier way?

Thanks.

Code:
saveBoxComments : function(){
        var formObj = this.getBoxCommentsFormPanel().getForm();
            var fieldValues = formObj.getFieldValues();
            var boxStatus = fieldValues.boxStatus;
            var status = true; 


            if(status){
                Ext.Ajax.request({
                url: SAVE_BOX_COMMENTS_URL,
                method: 'POST',
                params: {
                    positionDate:this.parentRecordData.data.positionDate,
                    groupId:this.parentRecordData.data.groupId,
                    boxStatus:fieldValues.boxStatus,
                    csrComment:fieldValues.csrComment
                },
                success : function(response) {                    
                    Ext.getCmp('boxCommentsWindow').close();
                    this.loadPositions();
                },
                scope: this
                });
            }
     }
Java method on the backend:

Code:
@RequestMapping(value = "/addBulkBoxPositionComments",method = RequestMethod.POST)
	public ReturnValue addBulkBoxPositionComments(
										@RequestParam(value = "positionDate") final String positionDate,	
										@RequestParam(value = "groupIds") final String groupIds,
										@RequestParam(value = "boxStatus") final String boxStatus,
										@RequestParam(value = "csrComment") final String csrComment,
										final HttpServletRequest request) {	
		return getReturnValue(new Runnable() {
			public void run() {		
				String groupIdList[] = groupIds.split(",");		
				String user = mercuryUserScreenNameGetter.getValue(request);
				Date date = Utils.parseDate(positionDate, DATE_FORMAT);
				Stream.of(groupIdList)
						.forEach(groupId -> 
							positionsDataMediator.addBoxAnnotation(date,user, groupId, csrComment, boxStatus));			
			}
		});	
	}