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

The following are Jave code examples for showing how to use setAutoPostBack() 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 newRowToAnaesthetic(LocalAnaestheticAdministeredVo anaesthetic)
{
	DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdAnaesthetic().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdAnaesthetic().getRows().newRow();
	DynamicGridCell cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_ANAESTHETIC), DynamicCellType.ENUMERATION);
	nRow.setValue(anaesthetic);
	if (anaesthetic != null && anaesthetic.getLocalAnaestheticIsNotNull())
	{
		DynamicGridCellItem item = cell.getItems().newItem(anaesthetic.getLocalAnaesthetic().getText());
		item.setValue(anaesthetic.getLocalAnaesthetic());
		cell.setValue(anaesthetic.getLocalAnaesthetic());
	}
	cell.setAutoPostBack(true);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING);
	cell.setValue(anaesthetic == null ? null : anaesthetic.getBatchNo());
	cell.setStringMaxLength(20);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
	cell.setValue(anaesthetic == null ? null : anaesthetic.getExpiryDate());
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void addAnaesthetisRow(LocalAnaestheticAdministeredVo localAnaestheticAdministeredVo)
{
	DynamicGridRow newRow = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getRows().newRow();
	newRow.setValue(localAnaestheticAdministeredVo);

	DynamicGridColumn column = null;
	DynamicGridCell cell = null;

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_DRUG);
	cell = newRow.getCells().newCell(column, DynamicCellType.ENUMERATION);

	populateLocalAnaesthetic(ims.clinical.vo.lookups.LookupHelper.getLocalAnaesthetic(domain.getLookupService()), cell);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getLocalAnaesthetic() : null);
	cell.setAutoPostBack(true);
	updateCell(cell);

	column = form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().getColumns().getByIdentifier(COL_MLS);
	cell = newRow.getCells().newCell(column, DynamicCellType.DECIMAL);
	cell.setValue(localAnaestheticAdministeredVo != null ? localAnaestheticAdministeredVo.getMls() : null);
	form.lyr1().tabDetails().ctn1().dyngrdAnaesthetis().setSelectedRow(null);
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void addLineSeparator()
{
	DynamicGridRow messageRow = form.lyrRules().tabActions().dyngrdActions().getSelectedRow();
	if (messageRow != null)
	{
		DynamicGridRow lineSeparatorInstanceRow = messageRow.getRows().newRow();
		DynamicGridColumn lineSeparatorInstanceColl = getColByIndexForActionGrid(0);
		if (lineSeparatorInstanceColl == null)
		{
			lineSeparatorInstanceColl = createColumnForActionGrid("", 0);
		}
		DynamicGridCell lineSeparatorInstanceCell = lineSeparatorInstanceRow.getCells().newCell(lineSeparatorInstanceColl, DynamicCellType.HTMLVIEW);
		lineSeparatorInstanceCell.setAutoPostBack(true);
		lineSeparatorInstanceCell.setWidth(250);
		lineSeparatorInstanceCell.setValue("--- Line Separator ---");
		lineSeparatorInstanceRow.setIdentifier(NOTIFICATION_LINE_SEPARATOR_INSTANCE);
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void addSpecialitiesRow(DynamicGridRow pRow, SpecialtyCollection specialty)
{
	if (specialty == null)
		return;

	for (int i = 0; i < specialty.size(); i++)
	{
		Specialty spe = specialty.get(i);
		DynamicGridRow nRow = pRow.getRows().newRow();

		nRow.setIdentifier(SPECIALTY_ROW_IDENTIFIER);
		nRow.setCollapsedImage(form.getImages().Admin.Specialty01);
		nRow.setExpandedImage(form.getImages().Admin.Specialty01);

		DynamicGridCell nCell = nRow.getCells().newCell(getColumn(form.lyrMain().tabByCategory().dyngrdMapps(), COLUMN_NAME), DynamicCellType.ENUMERATION);
		nCell.setReadOnly(false);
		nCell.setAutoPostBack(true);
		nCell.getItems().newItem(spe);
		nCell.setValue(spe);
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void addSpecialty()
{
	DynamicGridRow parent = form.lyrMain().tabByCategory().dyngrdMapps().getSelectedRow();

	if (parent.getParent() != null)
		parent = parent.getParent();

	DynamicGridRow nRow = parent.getRows().newRow();
	nRow.setIdentifier(SPECIALTY_ROW_IDENTIFIER);
	nRow.setCollapsedImage(form.getImages().Admin.Specialty01);
	nRow.setExpandedImage(form.getImages().Admin.Specialty01);

	DynamicGridCell nCell = nRow.getCells().newCell(getColumn(form.lyrMain().tabByCategory().dyngrdMapps(), COLUMN_NAME), DynamicCellType.ENUMERATION);
	nCell.setReadOnly(false);
	nCell.setAutoPostBack(false);
	form.lyrMain().tabByCategory().dyngrdMapps().setSelectedRow(nRow);

	parent.setExpanded(true);

	rebindCombos(parent);
	updateContextMenuState();
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void addRowToMedication(PatientMedicationLiteVo patientMedic)
{
	if (patientMedic == null)
		return;
	DynamicGridColumnCollection columns = form.lyrMain().tabDetails().dyngrdMedication().getColumns();
	DynamicGridRow nRow = form.lyrMain().tabDetails().dyngrdMedication().getRows().newRow();
	DynamicGridCell cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_MEDICATION), DynamicCellType.ENUMERATION);
	if (patientMedic != null && patientMedic.getMedicationIsNotNull())
		nRow.setValue(patientMedic);

	DynamicGridCellItem item = cell.getItems().newItem(patientMedic.getMedication().getMedicationName());
	item.setValue(patientMedic.getMedication());

	cell.setValue(patientMedic.getMedication());
	cell.setAutoPostBack(true);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_BATCHNO), DynamicCellType.STRING);

	cell.setValue(patientMedic.getBatchNo());
	cell.setStringMaxLength(20);
	cell = nRow.getCells().newCell(columns.getByIdentifier(COLUMN_EXPIRYDATE), DynamicCellType.DATE);
	cell.setValue(patientMedic.getExpiryDate());
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
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);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
/**
 * function used to populate dynamic grid row with root finding (backward
 * compatibility)
 */
private void setDynamicGridRootFindingRow(DynamicGridRow row, NeuroMotorRootValueVo 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.getRootValue() != null ? finding.getRootValue().getDescription() : "");
	cell.setIdentifier(finding.getRootValue());
	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 newConsultantAssociation(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CONSULTANT association to a null parrent row");
	
	if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CONSULTANTS)
		throw new CodingRuntimeException("Logical Error - Function must be called from CONSULTANTS category row only");

	
	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new MedicLiteVo());
	form.dyngrdAssociations().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Core.User);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void addFixedQuestions(DynamicGridRow row, WhiteBoardConfigVo whiteBoardConfig)
{
	if (whiteBoardConfig.getObsTaken())
	{
	DynamicGridCell cellObs = row.getCells().newCell(getColumnByIdentifier(COLUMN_OBS_REQUIRED), DynamicCellType.ENUMERATION);
	populateCellCombo(cellObs);
	}
	
	if (whiteBoardConfig.getMedsGiven())
	{
	DynamicGridCell cellMeds = row.getCells().newCell(getColumnByIdentifier(COLUMN_MEDS_GIVEN), DynamicCellType.ENUMERATION);
	populateCellCombo(cellMeds);
	}
	
	if (whiteBoardConfig.getECG())
	{
	DynamicGridCell cellECG = row.getCells().newCell(getColumnByIdentifier(COLUMN_ECG), DynamicCellType.BOOL);
	cellECG.setValue(null);
	cellECG.setAutoPostBack(true);
	cellECG.setReadOnly(false);
	}
	
	if (whiteBoardConfig.getNPO())
	{
	DynamicGridCell cellNPO = row.getCells().newCell(getColumnByIdentifier(COLUMN_NPO), DynamicCellType.BOOL);
	cellNPO.setValue(null);
	cellNPO.setAutoPostBack(true);
	cellNPO.setReadOnly(false);
	}
	
	if (whiteBoardConfig.getIsolation())
	{
	DynamicGridCell cellIsolation = row.getCells().newCell(getColumnByIdentifier(COLUMN_ISOLATION), DynamicCellType.BOOL);
	cellIsolation.setValue(null);
	cellIsolation.setAutoPostBack(true);
	cellIsolation.setReadOnly(false);
	}

}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void populateChildTargetNameCell(DynamicGridCell cellTargetName)
{
	cellTargetName.getItems().clear();
	cellTargetName.setAutoPostBack(true);
	TargetConfigurationShortVoCollection voColl = form.getLocalContext().getTargetConfigurationVoCollection();
	if (voColl == null)
	{
		voColl = domain.listTargetByCriteria(null);
	}
	
	for(int i = 0; voColl != null && i < voColl.size(); i++)
	{
		cellTargetName.getItems().newItem(voColl.get(i), form.getImages().Blackpool.Target);
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
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.getItems().newItem("Required","Required", form.getImages().Core.CriticalError);
	cellMeds.getItems().newItem("Completed","Completed", form.getImages().Correspondence.PatientDocumentCreated16);
	cellMeds.getItems().newItem("Not Required","Not Required", form.getImages().Correspondence.NoLetterRequired);
	*/
	cellMeds.setAutoPostBack(true);
	cellMeds.setReadOnly(false);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void addOverallStagingRow(TumourGroupSiteTNMValueListVo tValue, TumourGroupSiteTNMValueListVo nValue, TumourGroupSiteTNMValueListVo mValue)
{
	// Create new row
	DynamicGridRow overallRow = form.dyngrdOverall().getRows().newRow();

	// Create overall value
	TumourGroupSiteOverallStagingVo overall = new TumourGroupSiteOverallStagingVo();

	// Create cell for T value
	DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_T_VALUE);
	DynamicGridCell cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(tValue != null ? tValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setTVal(tValue);

	// Create cell for N value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_N_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(nValue != null ? nValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setNVal(nValue);

	// Create cell for M value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_M_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(mValue != null ? mValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setMVal(mValue);

	// WDEV-13091
	// Only T, N, M values are relevant for an Overall Staging recorded at Tumour Site level
	// The rest of the values were removed

	// Create cell for Overall Staging value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
	cell = overallRow.getCells().newCell(column, DynamicCellType.ENUMERATION);
	cell.setAutoPostBack(true);

	bindOverallValue(cell);
	cell.setValue(LookupHelper.getTumourOverallStage(domain.getLookupService()));
	cell.setIdentifier(LookupHelper.getTumourOverallStage(domain.getLookupService()));

	overall.setIsActive(Boolean.TRUE);
	overall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	overall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	overallRow.setValue(overall);
}
 
Example 14
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 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private DynamicGridRow addRuleLogicalCondition(RuleLogicalCondition condition)
{
	DynamicGridRow row = form.lyrRules().tabConditions().dyngrdConditions().getRows().get(0).getRows().newRow();
	row.setSelectable(true);

	int count = 1;

	DynamicGridColumn ifColl = getColByIndex(count);
	if (ifColl == null)
	{
		ifColl = createColumn("", count);
	}
	setRowIdentifier(row, count, RuleConditionType.LOGICAL);

	DynamicGridCell ifCell = row.getCells().newCell(ifColl, DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;
	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}
	setRowIdentifier(row, count, RuleConditionType.LOGICAL);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RuleLogicalCondition> listCondition = RuleLogicalCondition.getAll();
	for (int m = 0; m < listCondition.size(); m++)
	{
		valueCell.getItems().newItem(listCondition.get(m));
		valueCell.getItems().get(m).setIdentifier(listCondition.get(m));
	}

	row.setExpanded(true);
	valueCell.setAutoPostBack(true);
	valueCell.setWidth(120);

	valueCell.setValue(condition);
	valueCell.setIdentifier(condition);

	return row;
}
 
Example 16
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 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateEventTargetDinamicGrid(EventVo event) 
{
	initialiseEventTargetManagementDynamicGrid();
	DynamicGrid dynGrid = form.lyrTargets().tabEventTargets().dyngrdEventTargetManagement();

	EventTargetVoCollection voColl = domain.getEventTargetsByEvent(event);
	
	for (int i = 0; i < voColl.size(); i++) 
	{
		EventTargetVo vo = voColl.get(i);
		DynamicGridRow dynParentRow = dynGrid.getRows().newRow();
		dynParentRow.setIdentifier(PARENT);
		dynParentRow.setReadOnly(true);
		
		DynamicGridCell cellTargetName = dynParentRow.getCells().newCell(getColumn(COLNAME), DynamicCellType.ENUMERATION);
		populateParentTargetNameCell(cellTargetName);
		cellTargetName.setValue(vo.getTargetIsNotNull() ? vo.getTarget() : null);
		cellTargetName.setTooltip(vo.getTargetIsNotNull() ? vo.getTarget().getName() : null);

		DynamicGridCell cellSetToInScope = dynParentRow.getCells().newCell(getColumn(COLSETTOINSCOPE), DynamicCellType.BOOL);
		cellSetToInScope.setValue(vo.getSetToInScope());
		cellSetToInScope.setTooltip("Set To In Scope");
		cellSetToInScope.setAutoPostBack(true);

		DynamicGridCell cellJourneyTarget = dynParentRow.getCells().newCell(getColumn(COLJOURNEYTARGET), DynamicCellType.ENUMERATION);
		populateJourneyTargetCell(cellJourneyTarget);
		cellJourneyTarget.setValue(vo.getSetJourneyTargetStatusToIsNotNull() ? vo.getSetJourneyTargetStatusTo() : null);
		cellJourneyTarget.setTooltip(vo.getSetJourneyTargetStatusToIsNotNull() ? vo.getSetJourneyTargetStatusTo().getText() : null);
			
		DynamicGridCell cellStatus = dynParentRow.getCells().newCell(getColumn(COLSTATUS), DynamicCellType.ENUMERATION);
		if (vo.getStatus().equals(PreActiveActiveInactiveStatus.ACTIVE))
			populateStatusCell(cellStatus, PreActiveActiveInactiveStatus.PREACTIVE);
		else
			populateStatusCell(cellStatus, null);
		
		
		cellStatus.setValue(vo.getStatusIsNotNull() ? vo.getStatus() : null);
		cellStatus.setTooltip(vo.getStatusIsNotNull() ? vo.getStatus().getText() : null);
			
		dynParentRow.setValue(vo);
		dynGrid.setSelectedRow(dynParentRow);
		
		if (voColl.get(i).getActivateTargetsIsNotNull())
		{
			TargetRefVoCollection activateTargets = voColl.get(i).getActivateTargets();
			
			for (int j = 0; j < activateTargets.size(); j++) 
			{
				TargetRefVo activateTarget = activateTargets.get(j);
				DynamicGridRow dynChildRow = dynGrid.getSelectedRow().getRows().newRow();
				dynChildRow.setIdentifier(CHILD);
				dynChildRow.setReadOnly(true);
				dynGrid.getSelectedRow().setExpanded(true);
				
				DynamicGridCell cellChildTargetName = dynChildRow.getCells().newCell(getColumn(COLNAME), DynamicCellType.ENUMERATION);
				populateChildTargetNameCell(cellChildTargetName);
				cellChildTargetName.setValue(activateTarget);
			}		
		}
	}		
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Function used to populate a Patient ICP Action to a row
 * @param phaseRow 
 */
protected void populateICPAction(PatientICPAction_PresentationVo action, HcpDisType discipline, DynamicGridRow phaseRow)
{
	// Check if the action matches the filter discipline
	if (action == null || (discipline != null && !action.getAction().getDiscipline().contains(discipline)))
		return;
	
	// Check for action not to be outside of the scope
	if (ICPActionStatus.NOTINSCOPE.equals(action.getCurrentStatus().getStatus()))
		return;
	
	
	// Create action row
	DynamicGridRow actionRow = phaseRow.getRows().newRow();
	
	// Set row attributes
	actionRow.setSelectable(true);
	
	actionRow.setCollapsedImage(form.getImages().ICP.Action);
	actionRow.setExpandedImage(form.getImages().ICP.Action);
	
	if (isActionEditatble(action, form.getLocalContext().getLoggedInUser()))
	{
		actionRow.setBackColor(InScopeColor);
	}
	
	// Fill in row cells
	
		// Name cell
   		DynamicGridCell cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_PRESENTATION), DynamicCellType.STRING);
   		cell.setValue(action.getAction().getName());
   		cell.setTooltip(action.getAction().getName());
   		cell.setWidth(300);
   		cell.setReadOnly(true);

   		// Requires counter-signing cell
   		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_CONTER_SIGNATURE), DynamicCellType.IMAGE);
   		if (Boolean.TRUE.equals(action.getRequiresCounterSigning()))
   		{
   			cell.setValue(form.getImages().ICP.ACTION_OUTSANDING_ENABLED_16);
   			cell.setTooltip("Requires counter-signature.");
   		}
   		cell.setWidth(25);
   		cell.setReadOnly(true);
   		
   		// Status cell
   		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_STATUS), DynamicCellType.IMAGE);
   		cell.setValue(action.getCurrentStatus().getStatus().getImage());
   		cell.setTooltip(buildActionStatusTooltip(action));
   		cell.setWidth(40);
   		cell.setReadOnly(true);
   		
		cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_ACTION_DETAILS), DynamicCellType.BUTTON);
   		cell.setTooltip("Action details.");
   		cell.setWidth(25);
   		cell.setAutoPostBack(true);
   		
   		// Help cell
   		if (action.getAction().getHelpURLIsNotNull() && action.getAction().getHelpURL().length() > 0)
   		{
   			cell = actionRow.getCells().newCell(form.dyngrdICP().getColumns().getByIdentifier(COL_HELP), DynamicCellType.IMAGEBUTTON);
   			cell.setValue(form.getImages().Core.InfoEnabled16);
   			cell.setTooltip(action.getAction().getHelpURL());
   			cell.setWidth(25);
   			cell.setAutoPostBack(true);
   		}
	
	// Set row value
	actionRow.setValue(action);
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private DynamicGridRow addValueCondition(DynamicGridRow parentRow, boolean isNewValueCondition)
{
	DynamicGridRow row = parentRow.getRows().newRow();
	row.setSelectable(true);

	RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();

	int count = 1;

	if (vo != null)
		count = vo.getNumberOfColumns();

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell ifCell = row.getCells().newCell(getColByIndex(count), DynamicCellType.HTMLVIEW);
	ifCell.setValue(" <b>IF</b> ");
	ifCell.setWidth(30);

	count++;

	DynamicGridColumn valueColl = getColByIndex(count);
	if (valueColl == null)
	{
		valueColl = createColumn("", count);
	}

	setRowIdentifier(row, count, RuleConditionType.VALUE);

	DynamicGridCell valueCell = row.getCells().newCell(valueColl, DynamicCellType.ENUMERATION);
	List<RulesEngineEntity> entities = new Entities().getAllPublicEntities();

	for (int i = 0; i < entities.size(); i++)
	{
		valueCell.getItems().newItem().setValue(entities.get(i).getName());
		valueCell.getItems().get(i).setIdentifier(entities.get(i));
	}
	valueCell.setValue(form.lyrRules().tabConditions().cmbRootEntity().getValue().getName());
	valueCell.setReadOnly(true);

	if (isNewValueCondition)
		onDyngrdConditionsCellValueChanged(valueCell);

	valueCell.setAutoPostBack(true);
	valueCell.setWidth(0);

	return row;
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void populateGrid(CarePlanTitleCollection voCPs)
{
	form.dyngrdInterventions().getRows().clear();
	
	CarePlanCollection voCarePlans = null;
	
	if (voCPs != null && voCPs.size() > 0)
		voCarePlans = domain.listCarePlans(voCPs);
	
	for (int i = 0 ; voCarePlans != null && i < voCarePlans.size() ; i++)
	{
		voCarePlans.get(i).getInterventions().sort();
		
		for (int j = 0 ; voCarePlans.get(i).getInterventionsIsNotNull() && j < voCarePlans.get(i).getInterventions().size() ; j++)
		{
			CarePlanInterventions voInt = voCarePlans.get(i).getInterventions().get(j);
			
			DynamicGridRow row = form.dyngrdInterventions().getRows().newRow();
			//WDEV-16795 
			String removalInfo = "";
			if (voInt != null && Boolean.TRUE.equals(voInt.getIsRemoved()))
			{
				row.setReadOnly(true);
				row.setBackColor(Color.Gray);
				removalInfo = "<b>Care Plan Action Removed since: </b>" + voInt.getRemovedDate().toString(DateFormat.STANDARD);
			}
			
			DynamicGridCell cellOrdNum = row.getCells().newCell(getColumn(COLORDERNUMBER), DynamicCellType.STRING);
			cellOrdNum.setValue(voInt.getOrder().toString());
			//WDEV-16795
			cellOrdNum.setTooltip(voInt.getOrder().toString()+ (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
			cellOrdNum.setReadOnly(Boolean.TRUE);

			DynamicGridCell cellDesc = row.getCells().newCell(getColumn(COLDESC), DynamicCellType.STRING);
			cellDesc.setValue(voInt.getDescription().toString());
			//WDEV-16795
			cellDesc.setTooltip(voInt.getDescriptionIsNotNull() ? voInt.getDescription().toString() + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""): "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
			cellDesc.setReadOnly(Boolean.TRUE);
			
			DynamicGridCell cellInfo = row.getCells().newCell(getColumn(COLADDINFO), DynamicCellType.STRING);
			cellInfo.setValue(voInt.getAdditionalInfo());
			//WDEV-16795 
			cellInfo.setTooltip(voInt.getAdditionalInfoIsNotNull() ? voInt.getAdditionalInfo() : "" + (removalInfo.length() > 0 ? "<br/>" + removalInfo : ""));
			cellInfo.setReadOnly(Boolean.TRUE);
			
			DynamicGridCell cellComp = row.getCells().newCell(getColumn(COLCOMPLETED), DynamicCellType.BOOL, DynamicGridCellOptions.EDITABLE_DATA_CELL);
			cellComp.setValue(voInt.getStopDateIsNotNull() ? Boolean.TRUE : Boolean.FALSE);
			cellComp.setReadOnly(voInt.getStopDateIsNotNull() && !voInt.getIsRemoved());//WDEV-16795
			cellComp.setAutoPostBack(Boolean.TRUE);
			
			DynamicGridCell cellCompInfo = row.getCells().newCell(getColumn(COLWHENWHO), DynamicCellType.STRING);
			cellCompInfo.setValue(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
					(voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() : "" ) + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() : "" ) : "");
			//WDEV-16795 
			cellCompInfo.setTooltip(voInt.getStopDateIsNotNull() || voInt.getStopByIsNotNull() ? 
					(voInt.getStopDateIsNotNull() ? voInt.getStopDate().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") + " " + (voInt.getStopByIsNotNull() ? voInt.getStopBy().getName().toString() + (removalInfo.length() > 0 ? "\n" + removalInfo : "") : "") : "" + (removalInfo.length() > 0 ? "\n" + removalInfo : ""));
			cellCompInfo.setReadOnly(Boolean.TRUE);
			
			row.setValue(voCarePlans.get(i));
			row.setIdentifier(voInt);
		}
	}
}