package edu.duke.cabig.c3pr.web.ajax;

import org.extremecomponents.table.bean.Row;
import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.table.interceptor.RowInterceptor;

import edu.duke.cabig.c3pr.domain.Study;

public class StudyRowInterceptor implements RowInterceptor {

	public static final String VIEW_STUDY_URL = "../study/viewStudy?studyId=";
	
	public void addRowAttributes(TableModel tableModel, Row row) {
		// TODO Auto-generated method stub
		/*    	String url = "document.location='" + VIEW_STUDY_URL + study.getId().toString() + "'";
    	tableModel.getRowHandler().getRow().setOnclick(url);
    	tableModel.getRowHandler().getRow().setStyle("cursor:pointer");*/

	}

	public void modifyRowAttributes(TableModel model, Row row) {
		Study study= (Study) model.getCurrentRowBean();
		String url = "document.location='" + VIEW_STUDY_URL + study.getId().toString() + "'";
    	row.setOnclick(url);
    	row.setStyle("cursor:pointer");  
	}

}

@@ -480,233 +480,8 @@
 tub%0A
-%09%09/*    %09String url = %22document.location='%22 + VIEW_STUDY_URL + study.getId().toString() + %22'%22;%0A    %09tableModel.getRowHandler().getRow().setOnclick(url);%0A    %09tableModel.getRowHandler().getRow().setStyle(%22cursor:pointer%22);*/%0A%0A
 %09%7D%0A%0A

clean up