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

The following are Jave code examples for showing how to use getValue() 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 refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl)
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k);
				DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					loadPrintedStatus(printCell, true);
					printCell.setValue(PrintStatus.PRINTED);
					// Set the value of the row with a new one (otherwise
					// will get a Stale Object Exception when saving)
					SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl);
					if (voNewSavedValue != null)
						row.setValue(voNewSavedValue);
				}
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
/**
 * <b>WDEV-12569</b>
 * Function used to check for prognostic records not yet configured for the tumour group 
 */
private boolean hasUnconfiguredPrognostics()
{
	// Check for overall value (other values should be populated)
	for (int i = 0; i < form.dyngrdOverall().getRows().size(); i++)
	{
		DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
		DynamicGridRow row = form.dyngrdOverall().getRows().get(i);
		
		// If the row has an active overall value
		// Use the LiteVo version for value as this is the smallest type of VO
		if (row.getValue() instanceof OverallPrognosticGroupingLiteVo && ((OverallPrognosticGroupingLiteVo)row.getValue()).getIsActive())
		{
			DynamicGridCell cell = row.getCells().get(column);

			// If the value is null or TOBECONFIGURED then return as having stages not configured
			if (cell.getValue() == null || PrognosticGroup.TOBECONFIGURED.equals(cell.getValue()))
				return true;
		}
	}

	// All prognostic records are configured
	return false;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private void bindCertaintyFactor(TNMCertaintyFactorCollection certaintyFactor, DynamicGridCell certainValueCell, TNMCertaintyFactor certaintyFactorT)
{
	for (int i = 0; i < certaintyFactor.size(); i++)
	{
		if (certaintyFactor.get(i).isActive())
			certainValueCell.getItems().newItem(certaintyFactor.get(i), certaintyFactor.get(i).toString());
	}
	if (certaintyFactorT != null)
	{
		certainValueCell.setValue(certaintyFactorT);
		if (certainValueCell.getValue() == null)// Just set the value and cell value is null. Handle inactive
		{
			certainValueCell.getItems().newItem(certaintyFactorT, certaintyFactorT.toString());
			certainValueCell.setValue(certaintyFactorT);
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 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;
		}
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint()
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue());
				}
			}
		}
	}

	return voColl;
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 votes
protected void onDyngrdAssessmentsCellValueChanged(DynamicGridCell cell)
{
	// Refresh Reason Column
	DynamicGridColumn col = cell.getColumn();
	if (col != null && col.getIdentifier().equals(STATUS_COLUMN))
	{
		DynamicGridRow row = cell.getRow();
		if (row != null)
		{
			DynamicGridCell reasonCell = row.getCells().get(getDynGridColumn(REASON_COLUMN));
			Object statusValue = cell.getValue();
			if (reasonCell != null)
			{
				if (statusValue instanceof PatientAssessmentStatusReason)
					populateReasonCell(reasonCell, (PatientAssessmentStatusReason) statusValue);
			}
			else
			{
				reasonCell.getItems().clear();
			}
		}
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 6 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;
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private boolean isPrimaryPracticeMarked()
{
	DynamicGridRow pRow;
	for(int i = 0;i < form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getRows().size(); i++)
	{
		pRow = form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getRows().get(i);
		DynamicGridCell cell = pRow.getCells().get(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRIMARY));
		if (cell != null && cell.getValue() != null && cell.getValue().equals(Boolean.TRUE))
			return true; 
	}
	return false;
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private ArrayList<String> checkRow(DynamicGridRow row, ArrayList<String> errors)
{
	if (row.getIdentifier() != null && row.getIdentifier() instanceof RuleConditionRowVo)
	{
		RuleConditionRowVo vo = (RuleConditionRowVo) row.getIdentifier();
		int collNumbers = vo.getNumberOfColumns();

		if (vo.getType().equals(RuleConditionType.FIRST_LOGICAL) || vo.getType().equals(RuleConditionType.LOGICAL))
		{
			if (row.getRows() == null || (row.getRows() != null && row.getRows().size() == 0))
			{
				errors.add("Rule contains Logical Condition(s) without Value Condition(s)!");
			}
		}

		for (int i = 1; i <= collNumbers; i++)
		{
			if (getColByIndex(i) != null)
			{
				DynamicGridCell cell = row.getCells().get(getColByIndex(i));
				if (cell != null && cell.getValue() == null)
				{
					errors.add("Rule not valid! Your rule contain empty cell(s). Please check again.");
					return errors;
				}
			}
		}
		if (row.getRows() != null)
		{
			for (int j = 0; j < row.getRows().size(); j++)
			{
				checkRow(row.getRows().get(j), errors);
			}
		}
	}

	return errors;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
@Override
protected void onDyngrdLetterCellValueChanged(DynamicGridCell cell) 
{
	if(cell.getValue() != null && cell.getRow() != null && cell.getRow().getParent() != null && cell.getRow().getParent().getValue() instanceof Correspondence)
	{
		if(!(cell.getValue() instanceof Yes))
		{
			cell.getRow().setValue(cell.getValue());
		}
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateClinicAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Error");
	
	if (row.getValue() == null)
		row.setValue(new ClinicAccessVo());
	
	if (!(row.getValue() instanceof ClinicAccessVo))
		throw new CodingRuntimeException("BUG");
	

	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			((ClinicAccessVo) row.getValue()).setClinic(null);
			cell.setTypedText(null);
		}
		else
		{
			((ClinicAccessVo) row.getValue()).setClinic((ClinicLiteVo) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	cell.getValue();
	((ClinicAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 12
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void updateSpecialtyAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.SPECIALTY))
		throw new CodingRuntimeException("Major Logical Problem");
	
	if (row.getValue() == null)
		row.setValue(new SpecialtyAccessVo());
	
	if (!(row.getValue() instanceof SpecialtyAccessVo))
		throw new CodingRuntimeException("BUG");

	
	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			cell.setTypedText(null);
			((SpecialtyAccessVo) row.getValue()).setSpecialty(null);
		}
		else
		{
			((SpecialtyAccessVo) row.getValue()).setSpecialty((Specialty) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	((SpecialtyAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
@Override
protected void onDyngrdProceduresCellValueChanged(DynamicGridCell cell)
{
	if(cell.getColumn().equals(getSelectedColumn(COLMAIN)) && cell.getValue() instanceof Boolean && (Boolean) cell.getValue())
	{
		if(cell.getRow().getValue() instanceof ProcedureLiteVo)
			form.getLocalContext().setPrimaryProcedure((ProcedureLiteVo) cell.getRow().getValue());
		
		clearOtherRowsCheck(cell.getRow());
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void checkIfThereAreSameIdentifier(PatientIdCollection identifiers,	DynamicGridRow parentRow, DynamicGridColumn column) 
{
	if(identifiers == null || identifiers.size() == 0 || parentRow == null)
		return;
	
	for(int j = identifiers.size() - 1; j>=0; j--)
	{
		if(identifiers.get(j) == null)
			continue;
		
		for(int i=0; i<parentRow.getRows().size(); i++)
		{
			if(parentRow.getRows().get(i).getValue().equals(identifiers.get(j).getType()))
			{
				DynamicGridCell sourceIdentifierValueCell = parentRow.getRows().get(i).getCells().get(getColumn(COL_SOURCE_PATIENT));
				
				if(sourceIdentifierValueCell != null && sourceIdentifierValueCell.getValue() != null)
				{
					String destinationIdentifierValue = formatIdentifierValue(identifiers.get(j).getValue());
					
					if(sourceIdentifierValueCell.getValue().equals(destinationIdentifierValue))
					{
						DynamicGridCell cellNew = parentRow.getRows().get(i).getCells().newCell(column, DynamicCellType.STRING);
						cellNew.setValue(getColumn(COL_RESULT_DATA).equals(column) ? destinationIdentifierValue : identifiers.get(j).getValue());
						cellNew.setReadOnly(true);
					
						identifiers.remove(j);
						break;
					}
				}
			}
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private boolean sourceIsEqualWithDestination(DynamicGridRow row) 
{
	if(row == null)
		return false;
	
	DynamicGridCell sourceCell = row.getCells().get(getColumn(COL_SOURCE_PATIENT));
	DynamicGridCell destinationCell = row.getCells().get(getColumn(COL_DESTINATION_PATIENT));
	
	if((sourceCell == null && destinationCell == null) || (sourceCell != null && destinationCell != null && sourceCell.getValue() == null && destinationCell.getValue() == null) || (sourceCell != null && destinationCell != null && sourceCell.getValue() != null && sourceCell.getValue().equals(destinationCell.getValue())))
		return true;
	
	return false;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onDyngrdgrdTriageWorklistCellButtonClicked(DynamicGridCell cell)
{
	
	
	//wdev-17138	
	if( cell.getValue() != null && cell.getValue() instanceof DynamicGridCellTable)
    {
		
           DynamicGridCellTable helper = (DynamicGridCellTable)cell.getValue();
           if( helper.getFiredCell() != null && helper.getFiredCell().getIdentifier() != null)
           {
                  if( helper.getFiredCell().getIdentifier() instanceof SelectedTriageWorklistButtons)
                  {
               	   
               	    TrackingForClinicianWorklistAndTriageVo tempVo  = domain.getTrackingForClinicianWorklistAndTriage((TrackingForDisplayClinicianAndTriageWorklistVo)cell.getRow().getValue());//WDEV-18001
               	    if( tempVo != null && tempVo.getPatientIsNotNull() )
               	    {
               	    	form.getGlobalContext().Core.setPatientShort(domain.getPatientShort(tempVo.getPatient()));
               	    }
                    if( SelectedTriageWorklistButtons.STARTEDITTRIAGE.equals((SelectedTriageWorklistButtons) helper.getFiredCell().getIdentifier()))
                	{
                    	displayDetailsTab(DISPLAY_TRIAGE, (TrackingForDisplayClinicianAndTriageWorklistVo)cell.getRow().getValue(),true); //WDEV-18001
            			form.getLocalContext().setPreviousTab(DISPLAY_TRIAGE);  
                	}
                    else if( SelectedTriageWorklistButtons.PATIENTSUMMARY.equals((SelectedTriageWorklistButtons) helper.getFiredCell().getIdentifier()))
                    {
                    	//TrackingForClinicianWorklistAndTriageVo tempVo = (TrackingForClinicianWorklistAndTriageVo)cell.getRow().getValue();
            			
            			if( tempVo != null)
            			{
            				form.getGlobalContext().Core.setImsReportId(EMERGENCY_PATIENT_SUMMARY);
            				engine.open(form.getForms().Core.PrintReportByIMSId, new Object[] {CARE_CONTEXT_SEED, tempVo.getAttendance().getCareContext().getID_CareContext()});
            			}	
                    }
                    else if( SelectedTriageWorklistButtons.DECISIONTOAMIT.equals((SelectedTriageWorklistButtons) helper.getFiredCell().getIdentifier()))
                    {
                    	//TrackingForClinicianWorklistAndTriageVo tempVo = (TrackingForClinicianWorklistAndTriageVo)cell.getRow().getValue();
                    	form.getGlobalContext().Emergency.setTracking(tempVo);
            			
            			//WDEV-17661
            			if (ConfigFlag.GEN.ED_DTA_ADMISSION_FUNCTIONALITY.getValue().equals("PENDING"))
            			{
            				engine.open(form.getForms().Emergency.EDDecisionToAdmitDialog, new Object[] {tempVo});
            			}
            			else if (ConfigFlag.GEN.ED_DTA_ADMISSION_FUNCTIONALITY.getValue().equals("PARTIAL"))
            			{
            				engine.open(form.getForms().Emergency.EDPartialAdmissionDialog, new Object[] {tempVo});
            			}
                    }
                    else if( SelectedTriageWorklistButtons.VIEWHISTORY.equals((SelectedTriageWorklistButtons) helper.getFiredCell().getIdentifier()))
                    {
                    	engine.open(form.getForms().Emergency.AttendanceHistory);
                    }
                  }
           }
           //--------------
        

    }
	
	/*if( cell != null && cell.getColumn() != null && cell.getColumn().getIdentifier() != null &&  cell.getColumn().getIdentifier().equals(COLUMN_EXTTRANSFERTRIAGE ))		//wdev-16950
	{
		
	}
	*/
	
}
 
Example 17
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void printActionedRecords()
{
	String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();

	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		DynamicGridRow parentRow = form.dyngrdCollect().getRows().get(i);
		
		for (int j = 0; j < parentRow.getRows().size(); j++)
		{
			DynamicGridRow row = parentRow.getRows().get(j);
			
			DynamicGridCell cell = row.getCells().get(getColumn(ACTIONED_COL));
			
			boolean isActioned = false;
			
			if(cell != null && cell.getValue() instanceof Boolean)
				isActioned = ((Boolean)cell.getValue()).booleanValue();

			SpecimenWorkListItemListVo item = (SpecimenWorkListItemListVo) row.getValue();
			
			if(isActioned && item != null)
			{
				QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId());
				
				client.addSeed(new SeedValue("SpecimenWorkListItem_id", item.getID_SpecimenWorkListItem(), Integer.class));
				
				try
				{
					client.printReport(form.getGlobalContext().Core.getReport(), form.getGlobalContext().Core.getTemplate(), urlReportServer, form.getGlobalContext().Core.getPrinterSelect(), 1);
				} 
				catch (QueryBuilderClientException e1)
				{
					engine.showMessage("Error creating report: " + e1.getMessage());
					return;
				}
				
				//after the labels are printed, save the DFT investigation
				if (item.getDFTOrderInvestigation() != null)
				{
					item.setCollectionStatus(SpecimenCollectionStatus.COLLECTIONCOMPLETE);

					try
					{
						domain.saveWorkListItem(item);
					}
					catch (StaleObjectException e)
					{
						engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
					}

					populateCollectDataGrid(form.lyrPatDetails().tabPagePatientList().grdPatient().getValue(), getStatus());
				}
			}
		}
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private Patient_AssessmentQuestionVoCollection getQuestionRowAnswer(DynamicGridRow row, Patient_AssessmentQuestionVoCollection answers)
{
	if (row == null || row.getIdentifier() == null)
		return answers;

	if (answers == null)
		answers = new Patient_AssessmentQuestionVoCollection();

	Assessment_QuestionVo question = (Assessment_QuestionVo) row.getIdentifier();
	Patient_AssessmentQuestionVo answer = findOrCreateAnswer(answers, question);

	answer.setAssessmentQuestion(question);
	AnswerStatus status = AnswerStatus.ANSWERED;
	if (isDPP)
	{
		DynamicGridColumn column = this.grid.getColumns().getByIdentifier(NOTAPPLICABLE_COLUMN);
		if (column != null)

		{
			DynamicGridCell cellNA = row.getCells().get(column);
			if (cellNA.getValue() instanceof Boolean && ((Boolean) cellNA.getValue()).booleanValue())
				status = AnswerStatus.NOTAPPLICABLE;
		}
	}
	answer.setIsAnswered(status);
	answer.setIsMandatory(question.getIsMandatory());
	answer.setAllowsMultipleAnswers(question.getAllowsMultipleAnswersIsNotNull() ? question.getAllowsMultipleAnswers() : Boolean.FALSE);
	answer.setSequence(new Integer(overallQuestionSequence++));

	Answer_DetailsVoCollection answerDetails = new Answer_DetailsVoCollection();

	for (int x = 0; x < this.grid.getColumns().size(); x++)
	{
		DynamicGridCell cell = row.getCells().get(this.grid.getColumns().get(x));

		if (cell != null && !cell.getType().equals(DynamicCellType.DYNAMICLABEL) && !cell.getType().equals(DynamicCellType.EMPTY) && cell.getIdentifier() != null && (cell.getIdentifier() instanceof Question_AnswerTypeVo || cell.getIdentifier() instanceof Answer_CellData))
		{
			answerDetails.add(get_CellAnswer(cell));
		}
	}

	Patient_AssessmentAnswerVoCollection patientAnswers = answer.getPatientAnswers();
	if (patientAnswers == null)
		patientAnswers = new Patient_AssessmentAnswerVoCollection();
	else if (isFirstAnswer(row))
		patientAnswers.clear();

	Patient_AssessmentAnswerVo patientAnswer = (Patient_AssessmentAnswerVo) row.getValue();
	if (patientAnswer == null)
		patientAnswer = new Patient_AssessmentAnswerVo();

	patientAnswer.setAnswerDetails(answerDetails);
	patientAnswers.add(patientAnswer);

	answer.setPatientAnswers(patientAnswers);
	answers.add(answer);
	
	return answers;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void processCellPostback(DynamicGridCell cell)
{
	DynamicGridColumn actionedCol = getColumn(ACTIONED_COL);
	if(actionedCol == null)
		return;
	boolean actioned = cell.getRow().getCells().get(actionedCol).getValue().equals(Boolean.TRUE);
	
	if (actioned)
	{
		disableActionedColumn(cell);//disable other cells
		
		DynamicGridCell collectedCell = cell.getRow().getCells().get(getColumn(COLLECTED_COL));
		// Create Collected Cell
		if (collectedCell == null)
		{
			collectedCell = cell.getRow().getCells().newCell(getColumn(COLLECTED_COL), DynamicCellType.ANSWER);
			setAnswersOptionsToCell(collectedCell);
			collectedCell.setAutoPostBack(true);
		}

		if (cell.getColumn().equals(getColumn(COLLECTED_COL)))
		{
			if (cell.getValue() != null)
			{
				if (cell.getValue().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
				{
					createControlsForCollection(cell.getRow());
				}
				if (cell.getValue().equals(SpecimenCollectionStatus.COULDNOTCOLLECT))
				{
					createControlsForNotCollection(cell.getRow());
				}
				createCommonControls(cell.getRow());
			}
			else
			{
				removeCellByColumn(cell.getRow(), COLLECTED_COL);
				clearAllCells(cell.getRow());
				clearActionedColumn(cell.getRow());
				enableActionedColumn();
			}
		}
	}
	else
	{
		removeCellByColumn(cell.getRow(), COLLECTED_COL);
		clearAllCells(cell.getRow());
		enableActionedColumn();
	}
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private void processCellPostback(DynamicGridCell cell)
{
	DynamicGridColumn actionedCol = getColumn(ACTIONED_COL);
	
	if(actionedCol == null)
		return;
	
	boolean actioned = cell.getRow().getCells().get(actionedCol).getValue().equals(Boolean.TRUE);
	
	if (actioned)
	{
		disableActionedColumn(cell);//disable other cells
		 
		if (((SpecimenWorkListItemListVo) cell.getRow().getValue()).getDFTOrderInvestigation() != null)
		{
			return;
		}
		
		DynamicGridCell collectedCell = cell.getRow().getCells().get(getColumn(COLLECTED_COL));
		// Create Collected Cell
		if (collectedCell == null)
		{
			collectedCell = cell.getRow().getCells().newCell(getColumn(COLLECTED_COL), DynamicCellType.ANSWER);
			setAnswersOptionsToCell(collectedCell);
			collectedCell.setAutoPostBack(true);
		}

		if (cell.getColumn().equals(getColumn(COLLECTED_COL)))
		{
			if (cell.getValue() != null)
			{
				if (cell.getValue().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
				{
					createControlsForCollection(cell.getRow());
				}
				if (cell.getValue().equals(SpecimenCollectionStatus.COULDNOTCOLLECT))
				{
					createControlsForNotCollection(cell.getRow());
				}
				createCommonControls(cell.getRow());
			}
			else
			{
				removeCellByColumn(cell.getRow(), COLLECTED_COL);
				clearAllCells(cell.getRow());
				createCollectorsCommentsCell(cell); //WDEV-16812
				clearActionedColumn(cell.getRow());
				enableActionedColumn();
			}
		}
	}
	else
	{
		removeCellByColumn(cell.getRow(), COLLECTED_COL);
		clearAllCells(cell.getRow());
		createCollectorsCommentsCell(cell); //WDEV-16812
		enableActionedColumn();
	}
}