package gov.nih.nci.cabig.caaers.web.search.link;

import org.extremecomponents.table.cell.AbstractCell;
import org.extremecomponents.table.core.TableModel;
import org.extremecomponents.table.bean.Column;
import gov.nih.nci.cabig.caaers.domain.CtcTerm;
import gov.nih.nci.cabig.caaers.domain.AnatomicSite;

/**
 * @author Biju Joseph
 */
public class AnatomicSiteLinkDisplayCell extends AbstractCell {

    @Override
    protected String getCellValue(final TableModel model, final Column column) {

        AnatomicSite anatomicSite = (AnatomicSite) model.getCurrentRowBean();
        String cellValue = column.getValueAsString();
        String tableId = model.getTableHandler().getTable().getTableId();

        if (anatomicSite != null) {
            cellValue = "<a  href=\"javascript:fillDiseaseSiteAutoCompletor('"
                            + anatomicSite.getId() + "','" + tableId + "')\">"
                            + anatomicSite.getName() + "</a>";
        }
        return cellValue;
    }

}

@@ -55,54 +55,54 @@
 ort 
-org.extremecomponents.table.cell.AbstractCell;
+gov.nih.nci.cabig.caaers.domain.AnatomicSite;%0A
 %0Aimp
@@ -137,23 +137,19 @@
 ble.
-core.TableModel
+bean.Column
 ;%0Aim
@@ -185,120 +185,77 @@
 ble.
-bean.Column;%0Aimport gov.nih.nci.cabig.caaers.domain.CtcTerm;%0Aimport gov.nih.nci.cabig.caaers.domain.AnatomicSite
+cell.AbstractCell;%0Aimport org.extremecomponents.table.core.TableModel
 ;%0A%0A/
@@ -770,36 +770,8 @@
 r('%22
-%0A                           
  + a
@@ -795,16 +795,17 @@
 () + %22',
+ 
 '%22 + tab
@@ -810,16 +810,50 @@
 ableId +
+ %22','%22 +  anatomicSite.getName() +
  %22')%5C%22%3E%22
@@ -908,16 +908,41 @@
 ame() + 
+%0A                        
 %22%3C/a%3E%22;%0A

fix for CAAERS-887