private void open() { if(form.getGlobalContext().OCRR.getSelectedOrderSetIDIsNotNull()) { OrderSetEditVo record = domain.getOrderSet(form.getGlobalContext().OCRR.getSelectedOrderSetID()); if(record != null) { form.getLocalContext().setEditedRecord(record); populateScreenFromData(record); } else engine.showMessage("Order set not found"); } else { form.cmbStatus().setValue(PreActiveActiveInactiveStatus.PREACTIVE); } }
private String[] validateData(OrderSetEditVo record) { if(record == null) throw new CodingRuntimeException("Invalid order set record"); if(record.getActiveStatus() == null || !record.getActiveStatus().equals(PreActiveActiveInactiveStatus.ACTIVE)) return null; ArrayList errors = new ArrayList(); if(record.getComponent() == null || record.getComponent().size() == 0) { errors.add("No order set components configured"); } else { boolean exist = false; for(int x = 0; x < record.getComponent().size(); x++) { OrderSetComponentEditVo component = record.getComponent().get(x); if(component == null || (component.getInvestigation() == null && component.getOrderSet() == null)) { errors.add("Invalid order set component at position #" + String.valueOf(x + 1)); } else if(component.getInvestigation() != null || component.getOrderSet() != null) { exist = true; break; } } if(!exist) errors.add("No order set components configured"); } if(errors.size() == 0) return null; String[] err = new String[errors.size()]; for(int x = 0; x < errors.size(); x++) { err[x] = (String)errors.get(x); } return err; }
private void populateScreenFromData(ims.ocrr.vo.OrderSetEditVo value) { clearScreen(); if(value == null) return; this.form.txtCommonName().setValue(value.getCommonNameIsNotNull() ? value.getCommonName(): null); // ----- Start of grdComponents Grid -------------------------- ims.ocrr.vo.OrderSetComponentEditVoCollection fieldgrdComponents = value.getComponentIsNotNull() ? value.getComponent() : null; if(fieldgrdComponents != null) { fieldgrdComponents.sort(); for(int x = 0; x < fieldgrdComponents.size(); x++) { if(fieldgrdComponents.get(x) != null) { addComponent(fieldgrdComponents.get(x), false); } } } // ----- End of grdComponents Grid ---------------------------- this.form.txtName().setValue(value.getNameIsNotNull() ? value.getName(): null); this.form.cmbStatus().setValue(value.getActiveStatusIsNotNull() ? value.getActiveStatus() : null); this.form.txtDescription().setValue(value.getDescriptionIsNotNull() ? value.getDescription(): null); this.form.cmbColor().setValue(value.getColorIsNotNull() ? value.getColor() : null); //WDEV-11938 - starts here HelpTextVoCollection helpTextCol = value.getHelpText(); if(helpTextCol != null) { for(int i=0; i<helpTextCol.size(); i++) { HelpTextVo rowValue = helpTextCol.get(i); if(rowValue == null) continue; grdHelpTextRow newRow = form.grdHelpText().getRows().newRow(); newRow.setValue(rowValue); newRow.setcolTitle(rowValue.getTextCategory()); newRow.setcolText(rowValue.getHelpText()); } } //WDEV-11938 - ends here }