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

The following are Jave code examples for showing how to use setValidationMessage() 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 5 votes
private void setDiagnosisRow(DynamicGridRow row, PatientDiagnosisLiteVo diagnosis)
{
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not set a dose to null row");
	
	row.setValue(diagnosis);
	
	if (diagnosis == null)
		return;
	
	DynamicGridCell cell = row.getCells().newCell(form.lyrContent().tabConsultant().dyngrDiagnosis().getColumns().getByIdentifier(COL_DIAG_DESCRIPTION), DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setStringMaxLength(diagnosis.getDiagnosisDescriptionMaxLength());
	cell.setValidationMessage("Dose length is restricted to " + diagnosis.getDiagnosisDescriptionMaxLength() + " characters.");
	cell.setValue(diagnosis.getDiagnosisDescription());
	cell.setWidth(300);
	
	cell = row.getCells().newCell(form.lyrContent().tabConsultant().dyngrDiagnosis().getColumns().getByIdentifier(COL_DIAG_DATE), DynamicCellType.STRING); //wdev-9098
	cell.setReadOnly(true);
	cell.setValue(diagnosis.getDiagnosedDateIsNotNull() ? diagnosis.getDiagnosedDate().toString() : null);	//wdev-9098
	cell.setWidth(120);
	
	cell = row.getCells().newCell(form.lyrContent().tabConsultant().dyngrDiagnosis().getColumns().getByIdentifier(COL_DIAG_DIAGNOSE), DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setIdentifier(diagnosis.getDiagnosis());
	cell.setValue(diagnosis.getDiagnosis() != null ? diagnosis.getDiagnosis().getDiagnosisName() : "No diagnosis name provided");
	cell.setWidth(-1);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addSeed(ReportSeedParsedVo voSeed)
{
	if (voSeed == null)
		return;

	DynamicGridRow row = form.dyngrdParameters().getRows().newRow();

	DynamicGridCell nameCell = row.getCells().newCell(getColumn(NAME_COLUMN), DynamicCellType.WRAPTEXT);
	String seedName = getReportSeed().getCellName(voSeed);
	nameCell.setValue(seedName);
	nameCell.setReadOnly(true);

	DynamicCellType cellType = null;
	
	if(voSeed.getType().equalsIgnoreCase(INTEGER) && (voSeed.getName().equalsIgnoreCase("DOB") || voSeed.getName().equalsIgnoreCase("DOB_START") || voSeed.getName().equalsIgnoreCase("DOB_END") || voSeed.getName().equalsIgnoreCase("DATE_OF_BIRTH_FROM") || voSeed.getName().equalsIgnoreCase("DATE_OF_BIRTH_TO")))
	{
		cellType = DynamicCellType.PARTIALDATE;
	}
	else
		cellType = getReportSeed().getCellType(voSeed);
	
	Object value = getReportSeed().getValue(voSeed);

	DynamicGridCell valueCell = row.getCells().newCell(getColumn(VALUE_COLUMN), cellType);
	if (cellType.equals(DynamicCellType.QUERYCOMBOBOX))
	{
		valueCell.getItems().newItem(value);
		valueCell.setAutoPostBack(true);
	}

	if(cellType.equals(DynamicCellType.PARTIALDATE) && value instanceof java.lang.Integer)
	{
		valueCell.setValue(new PartialDate((Integer)value));
	}
	else
	{	
		valueCell.setValue(value);
	}
	
	valueCell.setIdentifier(getReportSeed().getIdentifier(voSeed));

	boolean canBeNull = voSeed == null ? true : voSeed.getCanBeNull().booleanValue();
	valueCell.setCanBeEmpty(canBeNull);
	
	if(canBeNull == false)
	{
		DynamicGridCell mandatoryCell = row.getCells().newCell(getColumn(MANDATORY_COLUMN), DynamicCellType.HTMLVIEW);
		mandatoryCell.setValue("<font color='#FF0000' size='3'>*</font>");
		mandatoryCell.setTooltip("Required");
		
		valueCell.setValidationMessage(seedName + " is mandatory");
	}
	
	row.setValue(voSeed);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void setDoseRowValue(DynamicGridRow row, MedicationDose dose)
{
	if (row == null)
		throw new CodingRuntimeException("Major Logical Error - Can not set a dose to null row");
	
	row.setValue(dose);
	
	if (dose == null)
		return;
	
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME), DynamicCellType.STRING);
	cell.setValidationMessage("Dose length is restricted to 255 characters.");
	cell.setValue(dose.getDose());
	cell.setWidth(120);
	cell.setReadOnly(true);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION);
	// bind to lookup
	cell.getItems().clear();
	MedicationRouteCollection medicationRouteCollection = LookupHelper.getMedicationRoute(domain.getLookupService());
	for (int i = 0; i < medicationRouteCollection.size(); i++)
	{
		MedicationRoute route = medicationRouteCollection.get(i);
		cell.getItems().newItem(route, route.getText());
	}
	cell.setValue(dose.getAdminRoute());
	cell.setWidth(120);
	cell.setReadOnly(true);
	
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.STRING);
	cell.setIdentifier(dose.getDoseStartHcp());
	cell.setValue(dose.getDoseStartHcp() != null ? dose.getDoseStartHcp().toString() : "");
	cell.setWidth(200);
	cell.setReadOnly(true);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE);
	cell.setValue(dose.getDoseStartDate());
	cell.setWidth(-1);
	cell.setReadOnly(true);
	
	row.setIdentifier(ROW_STATE_NOT_EDITABLE);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void newDose()
{
	DynamicGridRow row = form.dyngrdDoses().getRows().newRow();
	
	DynamicGridCell cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_DOSENAME), DynamicCellType.STRING);
	cell.setReadOnly(false);
	cell.setStringMaxLength(255);
	cell.setValidationMessage("Dose length is restricted to 255 characters.");
	cell.setWidth(120);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_ROUTE), DynamicCellType.ENUMERATION);
	cell.setReadOnly(false);
	// bind to lookup
	cell.getItems().clear();
	MedicationRouteCollection medicationRouteCollection = LookupHelper.getMedicationRoute(domain.getLookupService());
	for (int i = 0; i < medicationRouteCollection.size(); i++)
	{
		MedicationRoute route = medicationRouteCollection.get(i);
		cell.getItems().newItem(route, route.getText());
	}
	cell.setWidth(120);

	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_BY), DynamicCellType.STRING);
	cell.setReadOnly(true);
	cell.setIdentifier(domain.getHcpUser());
	cell.setValue(domain.getHcpUser() != null ? domain.getHcpUser().toString() : "");
	cell.setWidth(200);
	
	cell = row.getCells().newCell(form.dyngrdDoses().getColumns().getByIdentifier(COL_DOSE_COMMENCED_DATE), DynamicCellType.DATE);
	cell.setReadOnly(true);
	cell.setValue(new Date());
	cell.setWidth(-1);
	
	row.setValue(new MedicationDose());
	
	row.setIdentifier(ROW_STATE_EDITABLE);

	// Update grid selection
	form.dyngrdDoses().setSelectedRow(row);
}
 
Example 5
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();
}