当前位置: 代码迷 >> Web前端 >> 在后盾获取Jmesa中被选中的行(check=true)
  详细解决方案

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

热度:307   发布时间:2012-11-23 00:03:43.0
在后台获取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。
  相关解决方案