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

The following are Jave code examples for showing how to use setIntMaxLength() 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 addDFTInvestigationRow(OrderInvestigationListVo investigation)
{
	String invName = getInvName(investigation);

	DynamicGridRow parRow = form.dyngrdPrint().getRows().newRow();
	parRow.setSelectable(false);
	DynamicGridCell cell = parRow.getCells().newCell(getColumn(COL_INVESTIGATION), DynamicCellType.STRING);
	cell.setTooltip(invName);
	cell.setReadOnly(true);
	cell.setValue(invName);
	
	cell = parRow.getCells().newCell(getColumn(COL_NO_OF_LABELS_SETS), DynamicCellType.INT);
	cell.setReadOnly(false);
	cell.setValue(investigation.getInvestigation() != null ? investigation.getInvestigation().getNoLabelSets() : null);
	cell.setIntMaxLength(2); //restrict to 2 digits WDEV-16746
	
	cell = parRow.getCells().newCell(getColumn(COL_PRINTER), DynamicCellType.ENUMERATION);
	populateLocalPrinters(cell);
	
	cell = parRow.getCells().newCell(getColumn(COL_PREVIEW), DynamicCellType.IMAGEBUTTON);
	cell.setValue(form.getImages().Core.ZoomInEnabled16);
	cell.setAutoPostBack(true);
	
	parRow.setTextColor(ims.framework.utils.Color.Blue);
	parRow.setValue(investigation);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
/**
 * Addes the given GpToPracticesVo as the next row in the practices grid. 
 * @param GpToPracticesVo
 */
private void editPracticeRow(GpToPracticesVo voPractice, DynamicGridRow row)
{
	if (voPractice != null && row != null)
	{
		DynamicGridColumn nameColumn = form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRACTICENAME);
		if(nameColumn == null)
			return;
		
		row.setBackColor(Color.Beige);
		row.setBold(true);
		
		DynamicGridCell cell = row.getCells().newCell(nameColumn, DynamicCellType.STRING);
		String name = ""; 
		if ( voPractice.getPracticeIsNotNull() && voPractice.getPractice().getNameIsNotNull())
			name = voPractice.getPractice().getName();
		
		cell.setValue(name);
		cell.setTooltip(name);
		cell.setWidth(300);
		cell.setReadOnly(true);
		
		cell = row.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PASCODE), DynamicCellType.STRING);
		cell.setValue(voPractice.getGpCode());
		cell.setWidth(60);
		cell.setIntMaxLength(40);//WDEV-15431
		
		cell = row.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_PRIMARY), DynamicCellType.BOOL);
		cell.setValue(voPractice.getIsPrimaryPractice());
		cell.setAutoPostBack(true);
		cell.setWidth(60);
		
		cell = row.getCells().newCell(form.ctnGPDetails().lyrGPDetails().tabPractices().dyngrdPractices().getColumns().getByIdentifier(COL_ADDRESS), DynamicCellType.STRING);
		cell.setReadOnly(true);//WDEV-15431
		if (voPractice.getPracticeIsNotNull() && voPractice.getPractice().getAddressIsNotNull() && voPractice.getPractice().getAddress() != null)
		{
			String strAddress = voPractice.getPractice().getAddress().toDisplayString();
			if(strAddress.endsWith(","))
			{
				strAddress = strAddress.substring(0,strAddress.length()-1);
			
			}
			
			
			cell.setValue(strAddress);
			cell.setTooltip(strAddress);
			cell.setWidth(-1);
		}		
		
		row.setCollapsedImage(form.getImages().Admin.Organisation);
		row.setExpandedImage(form.getImages().Admin.Organisation);
		
		// if the site is using surgeries, display them on screen. otherwise, skip.
		if (ConfigFlag.DOM.GP_USE_SURGERIES.getValue())
		{
			if (voPractice.getPracticeIsNotNull() && voPractice.getPractice().getLocationSitesIsNotNull())
			{
				voPractice.getPractice().getLocationSites().sort();
				for(int x = 0; x < voPractice.getPractice().getLocationSites().size(); x++)
				{
					populateSurgeries(voPractice.getPractice().getLocationSites().get(x), row);
				}
				row.setExpanded(true);
			}
		}
		
		row.setSelectable(true);
		row.setValue(voPractice);
	}
}