gt: 		tableCell = tableRow.getCells().newCell();
context: //#############################################################################
  //#                                                                           #
  //#  Copyright (C) <2015>  <IMS MAXIMS>                                       #
  //#                                                                           #
  //#  This program is free software: you can redistribute it and/or modify     #
  //#  it under the terms of the GNU Affero General Public License as           #
  //#  published by the Free Software Foundation, either version 3 of the       #
  //#  License, or (at your option) any later version.                          # 
  //#                                                                           #
  //#  This program is distributed in the hope that it will be useful,          #
  //#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
  //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
  //#  GNU Affero General Public License for more details.                      #
  //#                                                                           #
  //#  You should have received a copy of the GNU Affero General Public License #
  //#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
  //#                                                                           #
  //#  IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of    #
  //#  this program.  Users of this software do so entirely at their own risk.  #
  //#  IMS MAXIMS only ensures the Clinical Safety of unaltered run-time        #
  //#  software that it builds, deploys and maintains.                          #
  //#                                                                           #
  //#############################################################################
  //#EOH
  // This code was generated by Florin Blindu using IMS Development Environment (version 1.80 build 4910.25978)
  // Copyright (C) 1995-2013 IMS MAXIMS. All rights reserved.
  
  package ims.emergency.forms.edwhiteboardpreviewdialog;
  
  import ims.admin.vo.AppImageVo;
  import ims.emergency.vo.WhiteBoardAssessmentConfigVo;
  import ims.emergency.vo.WhiteBoardAssessmentConfigVoCollection;
  import ims.emergency.vo.WhiteBoardConfigVo;
  import ims.emergency.vo.WhiteBoardQuestionConfigVo;
  import ims.emergency.vo.WhiteBoardQuestionConfigVoCollection;
  import ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues;
  import ims.framework.controls.DynamicGridCell;
  import ims.framework.controls.DynamicGridCellTable;
  import ims.framework.controls.DynamicGridCellTable.TableCell;
  import ims.framework.controls.DynamicGridCellTable.TableCellOptions;
  import ims.framework.controls.DynamicGridCellTable.TableCellType;
  import ims.framework.controls.DynamicGridCellTable.TableRow;
  import ims.framework.controls.DynamicGridColumn;
  import ims.framework.controls.DynamicGridRow;
  import ims.framework.enumerations.Align;
  import ims.framework.enumerations.Alignment;
  import ims.framework.enumerations.DialogResult;
  import ims.framework.enumerations.DynamicCellType;
  import ims.framework.enumerations.FontFamily;
  import ims.framework.enumerations.FontStyle;
  import ims.framework.enumerations.FontWeight;
  import ims.framework.enumerations.VerticalAlignment;
  import ims.framework.utils.Color;
  
  public class Logic extends BaseLogic
  {
  	private static final long serialVersionUID = 1L;
  
  	private static final String	COLUMN_PATIENT			= "0";
  	private static final String	COLUMN_LOCATION			= "1";
  	private static final String	COLUMN_COMMENT			= "2";
  	
  	@Override
  	protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
  	{
  		if (form.getGlobalContext().Emergency.getWhiteBoardConfig()==null)
  			return;
  		
  		initializeDynamicGrid();
  		addNewRow();
  	}
  	
  	private void addNewRow()
  	{
  		DynamicGridRow row = form.dyngrdWhiteBoard().getRows().newRow();
  		
  		addPatientButton(row);
  		
  		DynamicGridCell cellLoc = row.getCells().newCell(getColumnByIdentifier(COLUMN_LOCATION), DynamicCellType.STRING);
  		cellLoc.setValue("Location");
  		cellLoc.setTooltip("Location");
  		cellLoc.setReadOnly(true);
  		
  		addAssessmentsToGrid(row,form.getGlobalContext().Emergency.getWhiteBoardConfig().getAssessments());
  		addFixedQuestions(row,form.getGlobalContext().Emergency.getWhiteBoardConfig());
  		
  		if (form.getGlobalContext().Emergency.getWhiteBoardConfig().getComments())
  		{
  			DynamicGridCell cellComment = row.getCells().newCell(getColumnByIdentifier(COLUMN_COMMENT), DynamicCellType.IMAGEBUTTON);
      		
      		//Add Comment Button Cell
      		cellComment = row.getCells().newCell(getColumnByIdentifier(COLUMN_COMMENT), DynamicCellType.TABLE);
      		DynamicGridCellTable helper = new DynamicGridCellTable(cellComment);		
      		TableRow tableRow = helper.getRows().newRow();
      		TableCell tableCell = tableRow.getCells().newCell();
      		  		  tableCell.setType(TableCellType.BUTTON);		
      					
      		TableCellOptions cellOptions = new TableCellOptions();
      						 cellOptions.setAutopostback(true);
      						 cellOptions.setButtonImage(form.getImages().Core.Memo);
      						 cellOptions.setButtonImageText(" Comment");
      						 cellOptions.setButtonHeight(120);
      						 cellOptions.setButtonWidth(80);
      	
      		tableCell.setOptions(cellOptions);
      		cellComment.setValue(helper);
  		}
  	}
  	private void addConfigurableQuestions(DynamicGridRow row, WhiteBoardQuestionConfigVoCollection collOtherQuestions)
  	{
  		if (collOtherQuestions==null)
  			return;
  		
  		for (int i=0;i<collOtherQuestions.size();i++)
  		{
  			DynamicGridCell cellPain = row.getCells().newCell(getColumnByIdentifier(collOtherQuestions.get(i)), DynamicCellType.WRAPTEXT);
  			cellPain.setValue(collOtherQuestions.get(i).getQuestionText());
  			cellPain.setTooltip(collOtherQuestions.get(i).getQuestionText());
  			cellPain.setReadOnly(true);
  		}
  	}
  
  	private void addFixedQuestions(DynamicGridRow row, WhiteBoardConfigVo whiteBoardConfig)
  	{
  		
  
  	}
  	
  	private void populateCellCombo(DynamicGridCell cellMeds)
  	{
  		cellMeds.getItems().newItem(ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.REQUIRED,ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.REQUIRED.getText(),ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.REQUIRED.getImage());
  		cellMeds.getItems().newItem(ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.COMPLETE,ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.COMPLETE.getText(),ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.COMPLETE.getImage());
  		cellMeds.getItems().newItem(ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.NOT_REQUIRED,ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.NOT_REQUIRED.getText(),ims.emergency.vo.enums.EDWhiteBoardDynGrdComboValues.NOT_REQUIRED.getImage());
  		cellMeds.setValue(EDWhiteBoardDynGrdComboValues.REQUIRED);
  		
  		cellMeds.setAutoPostBack(true);
  		cellMeds.setReadOnly(false);
  	}
  	
  	private void addAssessmentsToGrid(DynamicGridRow row, WhiteBoardAssessmentConfigVoCollection collAssessments)
  	{
  		if (collAssessments==null)
  			return;
  		
  		for (int i=0;i<collAssessments.size();i++)
  		{
  			DynamicGridCell cellPain = row.getCells().newCell(getColumnByIdentifier(collAssessments.get(i)), DynamicCellType.INT);
  			cellPain.setValue(i);
  			cellPain.setTooltip(Integer.toString(i));
  			cellPain.setReadOnly(true);
  		}
  	
  	}
  	
  	private DynamicGridColumn getColumnByIdentifier( Object identifier)
  	{
  		return form.dyngrdWhiteBoard().getColumns().getByIdentifier(identifier);
  	}
  
  	private void addPatientButton(DynamicGridRow row)
  	{
  	
  		DynamicGridCell cellLabel = row.getCells().newCell(getColumnByIdentifier(COLUMN_PATIENT), DynamicCellType.TABLE);
  		DynamicGridCellTable helper = new DynamicGridCellTable(cellLabel);		
  		helper.setBorder(4);	
  				
  		helper.setBorder(4);		
  		
  		TableRow  tableRow = helper.getRows().newRow();
  			
  		//Patient			
  		TableCell tableCell = tableRow.getCells().newCell();
  		tableCell.setType(TableCellType.STRING);		
  		TableCellOptions cellOptions = new TableCellOptions();		
  						 cellOptions.setFontFamily(FontFamily.ARIAL);
  						 cellOptions.setFontSize(16);
  						 cellOptions.setFontWeight(FontWeight.BOLDER);
  						 cellOptions.setAlign(Align.LEFT);
  						 
  		tableCell.setOptions(cellOptions);
  		tableCell.setWidth(220);		
  		tableCell.setColSpan(4);			
  			
  		tableCell.setValue("Surname");
  		tableCell.setTooltip("Surname:Surname " );
  		
  		
  		tableRow = helper.getRows().newRow();   //wdev-17138
  		tableCell = tableRow.getCells().newCell();
  		tableCell.setType(TableCellType.STRING);		
  		cellOptions = new TableCellOptions();		
  						 cellOptions.setFontFamily(FontFamily.ARIAL);
  						 cellOptions.setFontSize(16);
  						 cellOptions.setFontWeight(FontWeight.BOLDER);
  						 cellOptions.setAlign(Align.LEFT);
  						
  						 
  		tableCell.setOptions(cellOptions);
  		tableCell.setWidth(220);		
  		tableCell.setColSpan(4);
  		
  		tableCell.setValue("Forename");
  		tableCell.setTooltip("Forename: Forename" );
  			
  			
  			
  		//Hospital
  		tableCell = tableRow.getCells().newCell();
  		tableCell.setType(TableCellType.STRING);
  		cellOptions = new TableCellOptions();		
  						 cellOptions.setTextColor(Color.Black);
  						 cellOptions.setFontFamily(FontFamily.CALIBRI);
  						 cellOptions.setFontSize(13);
  						 cellOptions.setAlign(Align.RIGHT);
  		tableCell.setOptions(cellOptions);
  		tableCell.setColSpan(2);
  		tableCell.setValue("3289537E");
  		tableCell.setTooltip("Hospital No.: 3289537E");
  				
  				
  		//Triage priority
  