private void populateScreenFromData(ResultSpecimenTypesVo value) { clearInstanceControls(); if(value == null) return; if(value.getAlternateSpecimenTypesIsNotNull()) { for(int i=0;i<value.getAlternateSpecimenTypes().size(); i++) { for(int p=0;p<form.grdResultSpecimenTypes().getRows().size();p++) { grdResultSpecimenTypesRow row = form.grdResultSpecimenTypes().getRows().get(p); if(row.getColResSpecimenType().equals(value.getAlternateSpecimenTypes().get(i))) row.setColSelect(true); } } } }
private void open() { clearInstanceControls(); form.grdList().getRows().clear(); ResultSpecimenTypesVoCollection voCollResSpecTypes = domain.listResultSpecimenTypes(); SpecimenTypeCollection collTypes = LookupHelper.getSpecimenType(domain.getLookupService()); for(int i=0;i<collTypes.size(); i++) { grdListRow row = form.grdList().getRows().newRow(); row.setColSpecimenType(collTypes.get(i)); //if lookup is already used in persisted record set the value for the row if(voCollResSpecTypes != null) { for(ResultSpecimenTypesVo instance : voCollResSpecTypes) { if(instance.getSpecimenType().equals(collTypes.get(i))) row.setValue(instance); } } } form.setMode(FormMode.VIEW); }