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

The following are Jave code examples for showing how to use getItems() 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
protected void onDyngrdCellValueChanged(DynamicGridCell cell)
{
	DynamicGridCellItemCollection items = cell.getItems();
	
	if (items != null && items.size() > 0)
	{
		for (int i = 0; i < items.size(); i++)
		{
			DynamicGridCellItem item = items.get(i);
			
			if (ENABLE_CLOSE.equals(item.getIdentifier()))
			{
				if (item.isChecked())
					form.getLocalContext().setCustomEvent(ChartingEvents.ENABLE_CLOSE);
				else
					form.getLocalContext().setCustomEvent(ChartingEvents.DISABLE_CLOSE);
				
				form.fireCustomControlValueChanged();
			}
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private ICspTypeSpecifier getSelectedItemFromCell(DynamicGridCell cell)
{
	if(cell.getItems() != null)
	{
		for(int i=0; i < cell.getItems().size(); i++)
		{
			if(((ICspTypeSpecifier) cell.getItems().get(i).getIdentifier()).getIGenericItemInfoName().equals(( String) cell.getValue()))
			{
				return (ICspTypeSpecifier) cell.getItems().get(i).getIdentifier();
			}
		}
	}
	return null;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 5 votes
private void setCellMultiAnswer(DynamicGridCell cell, Answer_OptionVoCollection items)
{
	if (!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");

	if (cell.getItems() != null)
	{
		for (int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;

			if (items != null)
			{
				for (int y = 0; y < items.size(); y++)
				{
					if (cell.getItems().get(x).getIdentifier() != null && cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
		
		if(displayAnsweredOnly)	//WDEV-12349
		{
			for (int a = cell.getItems().size() -1; a >=0; a--)
			{
				if(cell.getItems().get(a) != null && !cell.getItems().get(a).isChecked())
					cell.getItems().remove(cell.getItems().get(a));
			}
		}
	}
}
 
Example 5
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 6
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View Source Code Vote up 5 votes
private void setCellMultiAnswer(DynamicGridCell cell, Answer_OptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 7
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View Source Code Vote up 5 votes
private void setCellMultiAnswer(DynamicGridCell cell, AnswerOptionVoCollection items)
{
	if(!cell.getType().equals(DynamicCellType.MULTISELECT))
		throw new CodingRuntimeException("Multiple answer should be collected only for multiselect cells");
	
	if(cell.getItems() != null)
	{
		for(int x = 0; x < cell.getItems().size(); x++)
		{
			boolean checked = false;
			
			if(items != null)
			{
				for(int y = 0; y < items.size(); y++)
				{
					if(cell.getItems().get(x).getIdentifier() != null 
							&& cell.getItems().get(x).getIdentifier().equals(items.get(y)))
					{
						checked = true;
						break;
					}
				}
			}
			
			cell.getItems().get(x).setChecked(checked);
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
protected void onDyngrdResultsCellValueChanged(DynamicGridCell cell)
	{
		disableNavigation();
		
		form.imbClose().setEnabled(false);
		form.lnkViewPatientDetails().setVisible(false);
		//form.imbPrint().setEnabled(false);
		
		// WDEV-13321
		form.getLocalContext().setPickValue(null);
		
		DynamicGridCellItemCollection items = cell.getItems();
		for (int i = 0; i < items.size(); i++)
		{
			DynamicGridCellItem item = items.get(i);
			if (item.isChecked())
			{
				form.imbClose().setEnabled(true);
				//form.imbPrint().setEnabled(true);
				if(ConfigFlag.UI.DISPLAY_RESULT_PATIENT_DETAILS_LINK.getValue())
					form.lnkViewPatientDetails().setVisible(true);
				else
					form.lnkViewPatientDetails().setVisible(false);
				form.getLocalContext().setPickValue((Integer)item.getIdentifier());
				setNavigationState();
			}
		}
		
		// WDEV-13321
		// Default to responsible HCP clinician
		if (ResultDisplayHelper.PICK_QRY.equals(form.getLocalContext().getPickValue()))
		{
			// WDEV-18052 - Do not default in Medic
//			NewResultOcsOrderVo result = domain.getNewResultOcsOrderVo(form.getGlobalContext().OCRR.getCurrentPathRadResult().getOrderInvestigation());
//			
//			// WDEV-14097
//			// Default in only if the 'Responsible HCP' is a MEDIC
//			if (result.getResponsibleClinicianIsNotNull() && HcpDisType.MEDICAL.equals(result.getResponsibleClinician().getHcpType()))
//			{
//				form.ccMedicReview().setValue(result.getResponsibleClinician());
//			}
		}
		else
		{
			form.ccMedicReview().clear();
		}
		
		// WDEV-13321
		updateControlsState();
	}