在后台获取Jmesa中被选中的行(check=true)

/**
	 * To remove a AssayReturntypes 
	 * 
	 * @param request HttpServletRequest
	 * @param response HttpServletResponse
	 */
	@RequestMapping
	public void removeStudys(HttpServletRequest request, HttpServletResponse response) {
		
		WebContext webContext = new HttpServletRequestWebContext(request);
		WorksheetState state = new SessionWorksheetState("studysTable", webContext);
		Worksheet worksheet = state.retrieveWorksheet();
		Collection<WorksheetRow> rows = worksheet.getRows();
		List<Study> studys = new ArrayList<Study>();
		StringBuffer buffer = new StringBuffer();
		
		for (WorksheetRow row : rows) {
			String idStr = row.getUniqueProperty().getValue();
			Study study = new Study();
			if(!StringUtils.isEmpty(idStr) && StringUtils.isNumeric(idStr)) {
				study.setId(Integer.parseInt(idStr));
				studys.add(study);
			}
			buffer.append(idStr);
		}
		
		if (!studyService.removeStudy(studys)) {
			MessageUtils.outputJSONResult(buffer.toString(), response);
		}
	}


其中WorksheetState state = new SessionWorksheetState("studysTable", webContext);的studysTable为jmesa的id。

你可能感兴趣的:(jmesa)