Java Code Examples for ims.framework.controls.DynamicGridCell.setValue()

The following are Jave code examples for showing how to use setValue() of the ims.framework.controls.DynamicGridCell class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void addReferralLetterRow(DynamicGridRow row, PatientDocumentLiteVo doc)
{
	if(row == null || doc == null)
		return;
	
	String user = doc.getRecordingUserIsNotNull() ? doc.getRecordingUser().toString() : null;
	DateTime date = doc.getRecordingDateTimeIsNotNull() ? doc.getRecordingDateTime() : null;
	String title = "Recorded on <b>" + date + "</b> by <b>" + user + "</b>";
	
	DynamicGridRow letterRow = row.getRows().newRow();
	
	letterRow.setSelectable(true);
	letterRow.setExpandedImage(form.getImages().Core.PDFIcon);
	letterRow.setCollapsedImage(form.getImages().Core.PDFIcon);
	letterRow.setReadOnly(true);
	letterRow.setValue(doc);
	
	DynamicGridCell cell = letterRow.getCells().newCell(getCol(COL_TITLE_HIERARCHICAL), DynamicCellType.STRING);	

	cell.setReadOnly(true);
	cell.setValue(title);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private DynamicGridRow addReferralLetterLabel()
{
	DynamicGridRow row = form.dyngrdNotes().getRows().newRow();
	row.setSelectable(false);	
	row.setExpanded(false);
	
	row.setExpandedImage(form.getImages().Core.DocumentsBlue16);
	row.setCollapsedImage(form.getImages().Core.DocumentsBlue16);
	
	row.setReadOnly(true);
	
	DynamicGridCell cell = row.getCells().newCell(getCol(COL_TITLE_HIERARCHICAL), DynamicCellType.STRING);	
	
	cell.setReadOnly(true);
	cell.setValue(REFERRALS_LETTER);
	
	return row;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void updateRowTemplateCategory(DynamicGridRow row, Header header) 
{
	DynamicGridColumn column = null;
	DynamicGridCell cell = null;
	
	column = form.dyngrdHeaders().getColumns().getByIdentifier(COL_HEADING);
	cell = row.getCells().newCell(column,(form.getMode().equals(FormMode.EDIT) ? DynamicCellType.QUERYCOMBOBOX : DynamicCellType.STRING ));
	if(form.getMode().equals(FormMode.EDIT))
	{
		DynamicGridCellItem newComboItem = cell.getItems().newItem(header);
		cell.setValue(header);
	}
	else if(form.getMode().equals(FormMode.VIEW))
	{
		cell.setValue(header.getIItemText());
	}
	cell.setReadOnly(!form.getMode().equals(FormMode.EDIT));
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void setColAuthoringDetails(ClinicalNotesShortVoCollection voCollNotes, int i, DynamicGridRow row)
{
	DynamicGridColumn col = getCol("Authoring Details");
	if (col == null)
		throw new DomainRuntimeException("No column for Identifier");

	DynamicGridCell dateCell = row.getCells().newCell(col, DynamicCellType.WRAPTEXT);
	StringBuffer value = new StringBuffer();
	if (voCollNotes.get(i).getAuthoringInfo().getAuthoringHcpIsNotNull())
		value.append("HCP: " + voCollNotes.get(i).getAuthoringInfo().getAuthoringHcp().toString());
	if (voCollNotes.get(i).getAuthoringInfo().getAuthoringDateTimeIsNotNull())
	{
		if (value.length() > 0)
			value.append("\n");
		String voCollNotesAuthoringDateTime = voCollNotes.get(i).getAuthoringInfo().getAuthoringDateTime().toString();

		value.append("Date:" + voCollNotesAuthoringDateTime);
	}
	dateCell.setValue(value.toString());
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void populateCellItems(DynamicGridCell cell, ValueObjectCollection voColl)
{
	cell.getItems().clear();

	for (int i = 0; voColl != null && i < voColl.getItems().length; i++)
	{
		cell.getItems().newItem(voColl.getItems()[i], (voColl.getItems()[i]).toString());
	}

	if (voColl != null && voColl.getItems() != null)
	{
		if (voColl.getItems().length == 1)
			cell.setValue(voColl.getItems()[0]);
		else if (voColl.getItems().length > 1)
			cell.showOpened();
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private DynamicGridRow addConsultantToGrid(HcpLiteVo consultant)
{
	DynamicGridColumn mainCol = form.dyngrdMain().getColumns().getByIdentifier(MAIN_COLUMN);
	DynamicGridRow newRow = form.dyngrdMain().getRows().newRow();
	
	newRow.setExpandedImage(form.getImages().Admin.ConsultantEnabled16);
	newRow.setCollapsedImage(form.getImages().Admin.ConsultantEnabled16);
	
	DynamicGridCell newCell = newRow.getCells().newCell(mainCol, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
	if (consultant!=null)
	{
	newCell.getItems().newItem(consultant);
	newCell.setValue(consultant);
	}
	
	
	newCell.setAutoPostBack(true);
	return newRow;

}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void processCellPostback(DynamicGridCell cell)
{
	if(cell.getColumn().equals(form.dyngrdLinkedDataSets().getColumns().getByIdentifier(COL_ANSWERBOX)))
	{
		if(cell.getValue() == null)
			cell.setValue(LineTypeStatus.DEFAULT);
		
		if(cell.getValue().equals(LineTypeStatus.CUSTOM))
		{
			createVariableCells(cell.getRow(), false);
		}
		else if(cell.getValue().equals(LineTypeStatus.DEFAULT))
		{
			createVariableCells(cell.getRow(), true);
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
/**
 * function used to populate dynamic grid row with neuro motor area finding
 */
private void setDynamicGridMotorAreaFindingRow(DynamicGridRow row, NeuroMotorAreaFindingVo finding)
{
	if (finding == null)
		return;

	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a finding to a null row");

	// Set the row
	DynamicGridColumn column;
	DynamicGridCell cell;

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_MOTOR_AREA);
	cell = row.getCells().newCell(column, DynamicCellType.HTMLVIEW);
	cell.setValue(finding.getMotorAreaIsNotNull() ? finding.getMotorArea().getMotorAreaDescription() : ""); // wdev-14406
	cell.setIdentifier(finding.getMotorArea());
	cell.setReadOnly(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_RIGHT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getRightFinding() == null ? "" : (finding.getRightFinding() < 0 ? "N" : finding.getRightFinding().toString()));
	cell.setWidth(STANDARD_COLUMN_WIDTH);
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	column = form.dyngrdMotor().getColumns().getByIdentifier(COL_LEFT);
	cell = row.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(finding.getLeftFinding() == null ? "" : (finding.getLeftFinding() < 0 ? "N" : finding.getLeftFinding().toString()));
	cell.setReadOnly(false);
	cell.setAutoPostBack(true);

	row.setValue(finding);
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addPrescriptionDrugRow(DynamicGridRow row, PatientMedicationLiteVo patientMedication, boolean readOnly, boolean newRecord)
{
	DynamicGridColumn coll;
	DynamicGridCell cell;

	if (patientMedication == null)
		return;

	row.setIdentifier(PrescriptionDrug);
	row.setReadOnly(readOnly);
	
	if(newRecord)
		row.setBackColor(Color.Beige);

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_USER);
	cell = row.getCells().newCell(coll, DynamicCellType.HTMLVIEW);
	cell.setReadOnly(true);
	cell.setWidth(200);
	
	cell.setValue("<b><i>" + patientMedication.getMedication().getMedicationName() + "</i></b>");

	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_DRUG);
	coll.setCaption("Frequency");
	cell = row.getCells().newCell(coll, DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setWidth(100);

	cell.setValue(patientMedication != null ? (patientMedication.getFrequencyIsNotNull() ? patientMedication.getFrequency().getIItemText() : null) : null);
	
	coll = form.dyngrdPrescription().getColumns().getByIdentifier(COL_FREQUENCY);
	coll.setCaption("NoDaysSupply");
	cell = row.getCells().newCell(coll, DynamicCellType.INT);
	cell.setReadOnly(true);
	cell.setWidth(60);

	cell.setValue(patientMedication != null ? (patientMedication.getNoDaysSupplyIsNotNull() ? patientMedication.getNoDaysSupply() : null) : null);

	row.setValue(patientMedication);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void clearActionedColumn(DynamicGridRow row)
{
	DynamicGridCell cell;
	cell = row.getCells().get(getColumn(ACTIONED_COL));
	if (cell != null)
		cell.setValue(null);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void setAnswerCellValue(DynamicGridCell cell, QuestionAnswerTypeVo configAnswer, AnswerDetailsVo instAnswer)
{
	if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.SEPARATOR))
	{
		cell.setTextColor(DEFAULT_SEPARATOR_CELL_TEXT_COLOR);
		cell.setValue(" " + (configAnswer.getSeparatorTextIsNotNull() ? configAnswer.getSeparatorText() : "") + " ");
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.YESNO))
	{
		cell.getItems().clear();
		cell.getItems().newItem(this.optionYes, this.optionYes.getIItemImage());
		cell.getItems().newItem(this.optionNo, this.optionNo.getIItemImage());
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.PICKLIST))
	{
		setAnswerCellOptions(configAnswer, cell);
	}
	else if (configAnswer.getAnswerType().equals(ims.core.vo.lookups.QuestionAnswerType.MULTISELECT))
	{
		setAnswerCellOptions(configAnswer, cell, instAnswer);

		if (instAnswer != null)
		{
			if (instAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(instAnswer.getMaxMultiselectAllowed());
			}
		}
		else
		{
			if (configAnswer.getMaxMultiselectAllowedIsNotNull())
			{
				cell.setMaxCheckedItemsForMultiSelect(configAnswer.getMaxMultiselectAllowed());
			}
		}
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void initializeDynamicGrdMotor()
{
	form.dynQuestions().clear();
	
	DynamicGridColumn column = form.dynQuestions().getColumns().newColumn("Questions", QUESTIONS_COLUMN);
	column.setWidth(350);
	column.setReadOnly(true);

	DynamicGridColumn column2 = form.dynQuestions().getColumns().newColumn("Answers", ANSWERS_COLUMN);
	column2.setWidth(-1);
	column2.setReadOnly(false);
	
	AdmissionQuestionCollection admQuestions = new AdmissionQuestionCollection();
	admQuestions = LookupHelper.getAdmissionQuestion(domain.getLookupService());
	
	for (int i = 0; i < admQuestions.size(); i++)
	{
		AdmissionQuestion ar = admQuestions.get(i);
		DynamicGridRow row = form.dynQuestions().getRows().newRow();
		row.setValue(ar);
		row.setSelectable(false);
		
		DynamicGridCell cell = row.getCells().newCell(getColumn(QUESTIONS_COLUMN), DynamicCellType.WRAPTEXT);
		cell.setValue(ar.getText());
		cell.setTooltip(ar.getText());
		cell.setAutoPostBack(false);
		cell.setReadOnly(true);
		 
		DynamicGridCell cell2 = row.getCells().newCell(getColumn(ANSWERS_COLUMN), DynamicCellType.ANSWER);
		cell2.getItems().newItem(YesNo.NO,YesNo.NO.getImage());
		cell2.getItems().newItem(YesNo.YES,YesNo.YES.getImage());
		cell2.setValue(null);
		cell2.setAutoPostBack(false);			
		}		
	
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void newClinicCorrespondenceGridRow(DynamicGridRow parentRow, ClinicAccessVo clinicAccess)
{
	if (parentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add clinical access row to a null row");
	
	if (clinicAccess == null)
		return;
		
	
	DynamicGridCell newCell;
	DynamicGridColumn column;

	// Create a new row
	DynamicGridRow newRow = parentRow.getRows().newRow();
	newRow.setValue(clinicAccess);
	
	// Create the first cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic);
	
	// Create the second cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(clinicAccess.getClinic().getClinicName());
	newCell.setReadOnly(true);
	
	// Create the third cell in the row
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	newCell = newRow.getCells().newCell(column, DynamicCellType.ANSWER);
	engine.populate(newCell, Access.getNegativeInstancesAsIItemCollection());
	newCell.setValue(clinicAccess.getAccessRight());
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateProfile() 
{
	for (Correspondence correspondence : Correspondence.values())
	{
		DynamicGridRow row = form.dyngrdLetter().getRows().newRow();
		DynamicGridColumn column = null;
		DynamicGridCell cell = null;
		
		row.setBackColor(Color.Beige);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_IMAGE);
		cell = row.getCells().newCell(column, DynamicCellType.IMAGE);
		cell.setValue(getImageParent(correspondence));
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_HEADING);
		cell = row.getCells().newCell(column, DynamicCellType.STRING);
		cell.setValue(correspondence.getStringName());
		cell.setReadOnly(true);
		
		row.setExpanded(true);
		row.setValue(correspondence);
		
		NoLetterIsRequiredVoCollection listLetter = domain.listNoLetterIsRequired();
		
		if(listLetter != null)
		{
			for(int i=0; i<listLetter.size(); i++)
			{
				populateChilds(row, correspondence, listLetter.get(i));
			}
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void setDefaultTimeValue(DynamicGridCell cell)
{
	DynamicGridRow parentRow = cell.getRow().getParent();
	//Get Previous row time and set it to the current row
	for (int i = 0; parentRow != null && i < parentRow.getRows().size(); i++)
	{
		if(i > 0 && parentRow.getRows().get(i).getValue().equals(cell.getRow().getValue()))
		{
			DynamicGridColumn column = getColumn(TIME_COL);
			if(column != null)
			{
				DynamicGridCell timCell = parentRow.getRows().get(i-1).getCells().get(column);
				if(timCell != null)
				{
					Object previousTime = timCell.getValue();
					if(previousTime instanceof Time)
						cell.setValue(previousTime);
				}
			}
			
			break;
		}
	}
	if (cell.getValue() == null)
		cell.setValue(new Time()); 

}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private DynamicGridRow addRow(DynamicGridRow parent,LookupInstVo look, int depth)
{
	if (look == null)
		throw new CodingRuntimeException("Trying to add null value lookup instance");
	DynamicGridRow result ;
	if (parent == null)
		result =  form.dyngrdLookup().getRows().newRow();
	else
		result = parent.getRows().newRow();
	
	result.setSelectable(isSingleSelect());
	result.setCollapsedImage(null);
	result.setExpandedImage(null);
	DynamicGridCell nCell;
	if (!isSingleSelect())
	{
		DynamicGridColumn colSel = getColumn(COL_SELECT);
		if (colSel.getWidth() < depth * SELECT_WIDTH_N)
			colSel.setWidth(depth * SELECT_WIDTH_N);
		nCell = result.getCells().newCell(colSel,DynamicCellType.BOOL);
		nCell.setAutoPostBack(false);
		nCell.setReadOnly(false);
	}
	
	nCell = result.getCells().newCell(getColumn(COL_TXT), DynamicCellType.STRING);
	nCell.setAutoPostBack(false);
	nCell.setReadOnly(true);
	nCell.setValue(look.getText());
	
	result.setValue(look);
	
	return result;
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private DynamicGridRow createParent(ReferralApptStatus referralStatus)
{
	ReferralApptStatusCollection refStatusColl = getStatusList();
	refStatusColl.sort();
	ReferralApptStatusCollection refColl = form.getLocalContext().getusedParents();

	if (refColl != null)
	{
		refColl.sort();

		for (int j = 0; j < refColl.size(); j++)
		{
			if (refStatusColl.contains(refColl.get(j)))
			{
				refStatusColl.remove(refColl.get(j));
			}
		}
	}
	refStatusColl.add(referralStatus);
	refStatusColl.sort();
	DynamicGridRow row = form.dyngrdStatus().getRows().newRow();
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdStatus().getColumns().get(0), DynamicCellType.ENUMERATION);
	row.setExpanded(true);
	populateCell(refStatusColl, cell, row);
	cell.setIdentifier(referralStatus.getIItemText());
	cell.setValue(referralStatus);
	row.setValue(referralStatus);

	return row;
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void fillCombosAndGridsFromTumourSite(TumourSiteVo voTumourSite) 
{
	form.lyrDetails().tabTNM().cmbPathologicalT().clear();
	form.lyrDetails().tabTNM().cmbPathologicalN().clear();
	form.lyrDetails().tabTNM().cmbPathologicalM().clear();
	
	form.lyrDetails().tabTumDetails().dyngrdHistology().getRows().clear();
	form.lyrDetails().tabTNM().dyngrdTCategory().getRows().clear();
	form.lyrDetails().tabTNM().dyngrdMCategory().getRows().clear();
	
	for(int i = 0 ; i < voTumourSite.getTNMValues().size() ; i++)
	{
		if (voTumourSite.getTNMValues().get(i).getTNMType().equals(TNMType.T)
			&& voTumourSite.getTNMValues().get(i).getIsActiveIsNotNull()
			&& voTumourSite.getTNMValues().get(i).getIsActive())
			addTRows(voTumourSite.getTNMValues().get(i));

		if (voTumourSite.getTNMValues().get(i).getTNMType().equals(TNMType.N)
			&& voTumourSite.getTNMValues().get(i).getIsActiveIsNotNull()
			&& voTumourSite.getTNMValues().get(i).getIsActive())
			form.lyrDetails().tabTNM().cmbPathologicalN().newRow(voTumourSite.getTNMValues().get(i), voTumourSite.getTNMValues().get(i).getTNMDescription());

		if (voTumourSite.getTNMValues().get(i).getTNMType().equals(TNMType.M)
			&& voTumourSite.getTNMValues().get(i).getIsActiveIsNotNull()
			&& voTumourSite.getTNMValues().get(i).getIsActive())
			addMRows(voTumourSite.getTNMValues().get(i));
	}
	
	for(int j = 0 ; voTumourSite.getHistologiesIsNotNull() && j < voTumourSite.getHistologies().size() ; j++)
	{
		DynamicGridRow histRow = form.lyrDetails().tabTumDetails().dyngrdHistology().getRows().newRow();
		DynamicGridCell cellHist = histRow.getCells().newCell(getHistologyGridColumn(COL_HISTOLOGY), DynamicCellType.STRING);
		// WDEV-11684
		cellHist.setValue(voTumourSite.getHistologies().get(j).getAssociatedHistology().getHistologyDescription());
		//WDEV-16966
		cellHist.setReadOnly(Boolean.TRUE);
		if (form.getMode().equals(FormMode.EDIT))
			histRow.getCells().newCell(getHistologyGridColumn(COL_SELECT), DynamicCellType.BOOL);
		histRow.setValue(voTumourSite.getHistologies().get(j).getAssociatedHistology());	//WDEV-13126
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void newMedicationDoseInstance() 
{
	DynamicGridRow doseRow = form.ctnDetails().dyngrdDoses().getRows().newRow();
	
	
	DynamicGridCell cell1 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSE), DynamicCellType.STRING);
	
	cell1.setStringMaxLength(255);
	cell1.setValidationMessage("This text is restricted to 255 characters");
	cell1.setReadOnly(false);
	cell1.setTooltip("Please select a Dose");
	cell1.setWidth(120);

	DynamicGridCell cell2= doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION);
	cell2.setReadOnly(false);
	bindCellToLookup(cell2, MedicationRoute.class);
	cell2.setTooltip("Please select a Route");
	cell2.setWidth(120);

	DynamicGridCell cell3 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_TIMES), DynamicCellType.MULTISELECT);
	cell3.setReadOnly(false);
	bindCellToLookup(cell3, MedicationTimesOfAdministration.class);
	cell3.setTooltip("Please select Times");
	cell3.setWidth(140);

	DynamicGridCell cell6= doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY_TYPE), DynamicCellType.ENUMERATION);
	cell6.setReadOnly(false);
	bindCellToLookup(cell6, MedciationCommencedDiscontinuedType.class);
	cell6.setValue(MedciationCommencedDiscontinuedType.MOS);
	cell6.setTooltip("Please select a Commenced by Type");
	cell6.setAutoPostBack(true);
	cell6.setWidth(140);

	
	DynamicGridCell cell4 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.QUERYCOMBOBOX);
	Hcp hcp = (Hcp) domain.getHcpUser();
	if(hcp != null)
	{
		cell4.getItems().newItem(hcp);
		cell4.setValue(hcp);
	}
	cell4.setReadOnly(false);
	cell4.setAutoPostBack(true);
	cell4.setTooltip("Please select a HCP");
	cell4.setWidth(160);

	
	DynamicGridCell cell5 = doseRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE);
	cell5.setValue(new Date());
	cell5.setReadOnly(false);
	cell5.setTooltip("Please select a Date");
	cell5.setWidth(-1);

	doseRow.setExpanded(true);
	
	MedicationDose voNewDose = new MedicationDose();
	voNewDose.setIsCopied(new Boolean(false));
	doseRow.setValue(voNewDose);
	
	//wdev-1873 form.ctnDetails().dyngrdDoses().setSelectedRow(doseRow);
	//added for WDEV-7307
	if  (!engine.isDialog()){
		form.ctnDetails().dyngrdDoses().resetScrollPosition();
		form.ctnDetails().dyngrdDoses().setSelectedRow(doseRow);
	}
	updateControlsState();
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void fillDosesGridReadOnly(MedicationDoseCollection prescribedDoses) 
{
	form.ctnDetails().dyngrdDoses().getRows().clear();
	for(int i = 0 ; i < prescribedDoses.size() ; i++)
	{
		DynamicGridRow childRow = form.ctnDetails().dyngrdDoses().getRows().newRow();
		
		MedicationDose voDose = prescribedDoses.get(i);
		
		DynamicGridCell cell1 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSE), DynamicCellType.LABEL);
		cell1.setValue(voDose.getDoseIsNotNull() ? voDose.getDose() : "");
		cell1.setTooltip(voDose.getDiscontinuedTooltip());
		cell1.setIdentifier(voDose.getDose());
		cell1.setWidth(120);

		DynamicGridCell cell2 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.LABEL);
		cell2.setValue(voDose.getAdminRouteIsNotNull() ? voDose.getAdminRoute().toString() : "");
		cell2.setIdentifier(voDose.getAdminRoute());
		cell2.setWidth(120);

		DynamicGridCell cell3 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_TIMES), DynamicCellType.LABEL);
		cell3.setValue(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : "");
		cell3.setTooltip(voDose.getAdminTimesIsNotNull() ? createTimesString(voDose.getAdminTimes()) : "");
		cell3.setIdentifier(voDose.getAdminTimes());
		cell3.setWidth(140);

		DynamicGridCell cell6 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY_TYPE), DynamicCellType.LABEL);
		cell6.setValue(voDose.getCommencedByTypeIsNotNull() ? voDose.getCommencedByType().toString() : "");
		cell6.setIdentifier(voDose.getCommencedByType());
		cell6.setWidth(140);

		DynamicGridCell cell4 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.LABEL);
		cell4.setValue(voDose.getDoseStartHcpIsNotNull() ? voDose.getDoseStartHcp().toString() : "");
		cell4.setIdentifier(voDose.getDoseStartHcp());
		cell4.setWidth(160);

		DynamicGridCell cell5 = childRow.getCells().newCell(form.ctnDetails().dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.LABEL);
		cell5.setValue(voDose.getDoseStartDateIsNotNull() ? voDose.getDoseStartDate().toString() : null);
		cell5.setIdentifier(voDose.getDoseStartDate());
		cell5.setWidth(-1);
		

		childRow.setValue(voDose);
		
		childRow.setExpanded(true);
		
		if ( (voDose.getIsStoppedIsNotNull()) && (voDose.getIsStopped().booleanValue()) )
			childRow.setBold(false);
		else
			childRow.setBold(true);
	}
}