@@ -102,7 +102,7 @@ public TableInfo getTable(String name, @Nullable ContainerFilter cf, boolean inc
102102 @ Override
103103 public @ Nullable TableInfo createDataTable (ContainerFilter cf , boolean includeCopiedToStudyColumns )
104104 {
105- FilteredTable <?> table = (FilteredTable )new GenotypingQuerySchema (getUser (), getContainer ()).getTable (GenotypingQuerySchema .TableType .AnimalAnalysis .name (), cf ,true , true );
105+ FilteredTable <?> table = (FilteredTable <?> )new GenotypingQuerySchema (getUser (), getContainer ()).getTable (GenotypingQuerySchema .TableType .AnimalAnalysis .name (), cf ,true , true );
106106 List <FieldKey > keys = new ArrayList <>(table .getDefaultVisibleColumns ());
107107 HashSet <String > defaults = HaplotypeAssayProvider .getDefaultColumns ();
108108 List <? extends DomainProperty > props = HaplotypeAssayProvider .getDomainProps (getProtocol ());
@@ -147,14 +147,15 @@ private ExprColumn makeColumnFromRunField(DomainProperty prop, boolean max, SQLF
147147
148148 String field = prop .getName ();
149149 String label = prop .getLabel () != null ? prop .getLabel () : ColumnInfo .labelFromName (prop .getName ());
150- String type = field .substring (0 , prop .getName ().length ()-1 ).replaceAll ("Haplotype" , "" ); //ColumnInfo.labelFromName(prop.getName()).split(" ")[0];
150+ String type = field .substring (0 , prop .getName ().length ()-1 ).replace ("Haplotype" , "" ); //ColumnInfo.labelFromName(prop.getName()).split(" ")[0];
151151
152152 SQLFragment sql = new SQLFragment ("(SELECT " );
153153 sql .append ("min" );
154154 sql .append ("(x.Haplotype) FROM (" );
155155 sql .append (selectStatement );
156- sql .append (") AS x WHERE x.DiploidNumber = ? AND x.Type = '" + type + "' AND x.AnimalAnalysisId = " + ExprColumn .STR_TABLE_ALIAS + ".RowID)" );
156+ sql .append (") AS x WHERE x.DiploidNumber = ? AND x.Type = ? AND x.AnimalAnalysisId = " + ExprColumn .STR_TABLE_ALIAS + ".RowID)" );
157157 sql .add (max ? 2 : 1 );
158+ sql .add (type );
158159 ExprColumn column = new ExprColumn (table , field , sql , JdbcType .VARCHAR );
159160 TableInfo haplotypeDetailsTableInfo = getHaplotypeDetailsTableInfo ();
160161 if (haplotypeDetailsTableInfo != null && haplotypeDetailsTableInfo .getGridURL (getContainer ()) != null )
@@ -180,8 +181,7 @@ public DataView createDataView()
180181 {
181182 DataView result = super .createDataView ();
182183 DataRegion rgn = result .getDataRegion ();
183-
184- ButtonBar bar = result .getDataRegion ().getButtonBar (DataRegion .MODE_GRID );
184+ ButtonBar bar = rgn .getButtonBar (DataRegion .MODE_GRID );
185185 if (!bar .isLocked ())
186186 {
187187 ActionButton reportButton = new ActionButton (GenotypingController .HaplotypeAssignmentReportAction .class , "Produce Report" );
0 commit comments