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

The following are Jave code examples for showing how to use setCanBeEmpty() 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 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);
}