private boolean save() { TreatmentEquipmentConfigVo voTreatEquipConfig = populateInstanceData(); //validate Vo String[] arrErrors = voTreatEquipConfig.validate(); if(arrErrors != null) { engine.showErrors(arrErrors); return false; } try { form.getLocalContext().setSelectedRecord(domain.save(voTreatEquipConfig)); } catch(StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } return true; }
private void populateChildInstanceControls(ElectrotherapyUltrasoundTreatmentVo voUltraTreat) { if (voUltraTreat == null ) return; form.ctnUltra().lyrUltra().tabDetails().cmbTarget().setValue(voUltraTreat.getTarget()); if(voUltraTreat.getAreaTreated() != null) form.ctnUltra().lyrUltra().tabDetails().cmbAreaTreated().newRow(voUltraTreat.getAreaTreated(), voUltraTreat.getAreaTreated().toString()); form.ctnUltra().lyrUltra().tabDetails().cmbAreaTreated().setValue(voUltraTreat.getAreaTreated()); form.ctnUltra().lyrUltra().tabDetails().cmbMuscle().setValue(voUltraTreat.getMuscleAspect()); form.ctnUltra().lyrUltra().tabDetails().cmbLaterality().setValue(voUltraTreat.getLaterality()); form.ctnUltra().lyrUltra().tabDetails().txtComment().setValue(voUltraTreat.getComment()); form.ctnUltra().lyrUltra().tabDetails().cmbWave().setValue(voUltraTreat.getWave()); form.ctnUltra().lyrUltra().tabDetails().cmbPulse().setValue(voUltraTreat.getPulse()); form.ctnUltra().lyrUltra().tabDetails().cmbFreq().setValue(voUltraTreat.getFrequency()); form.ctnUltra().lyrUltra().tabDetails().cmbIntensity().setValue(voUltraTreat.getIntensity()); form.ctnUltra().lyrUltra().tabDetails().intDuration().setValue(voUltraTreat.getDuration()); TreatmentEquipmentConfigVo voTreatmentEquipment = voUltraTreat.getMachineUsed(); form.ctnUltra().lyrUltra().tabDetails().cmbMachine().setValue(voTreatmentEquipment); form.ctnUltra().lyrUltra().tabDetails().txtModel().setValue(voTreatmentEquipment != null ? voTreatmentEquipment.getModel() : null); form.ctnUltra().lyrUltra().tabDetails().txtSerial().setValue(voTreatmentEquipment != null ? voTreatmentEquipment.getSerialNumber(): null); }
private void newInstance() { // initalise the screen for a new record form.getLocalContext().setSelectedRecord(new TreatmentEquipmentConfigVo()); form.grdDetails().setValue(null); form.ctnConfig().txtDescription().setFocus(); clearInstanceControls(); form.ctnConfig().setCollapsed(false); form.setMode(FormMode.EDIT); }
protected void onGrdDetailsSelectionChanged() throws PresentationLogicException { //Display Panel and detail if(form.grdDetails().getValue() != null) { form.getLocalContext().setSelectedRecord((TreatmentEquipmentConfigVo) form.grdDetails().getValue()); populateInstanceControl(form.grdDetails().getValue()); form.ctnConfig().setCollapsed(false); } updateControlsState(); }
private void populateInstanceControl(ValueObject voRef) { clearInstanceControls(); if (voRef != null) super.populateScreenFromData((TreatmentEquipmentConfigVo) voRef); }
private void setMachineValues() { if(form.ctnUltra().lyrUltra().tabDetails().cmbMachine().getValue() != null) { TreatmentEquipmentConfigVo voTreatmentEquipment = form.ctnUltra().lyrUltra().tabDetails().cmbMachine().getValue(); form.ctnUltra().lyrUltra().tabDetails().txtModel().setValue(voTreatmentEquipment.getModel()); form.ctnUltra().lyrUltra().tabDetails().txtSerial().setValue(voTreatmentEquipment.getSerialNumber()); } else //WDEV-15389 { form.ctnUltra().lyrUltra().tabDetails().txtModel().setValue(null); form.ctnUltra().lyrUltra().tabDetails().txtSerial().setValue(null); } }
protected void onCmbMachineValueChanged() throws PresentationLogicException { if(form.ctnPneumatic().lyrPneumatic().tabDetails().cmbMachineUsed().getValue()!=null) { TreatmentEquipmentConfigVo voTreatmentEquipment = form.ctnPneumatic().lyrPneumatic().tabDetails().cmbMachineUsed().getValue(); form.ctnPneumatic().lyrPneumatic().tabDetails().txtModel().setValue(voTreatmentEquipment.getModel()); form.ctnPneumatic().lyrPneumatic().tabDetails().txtSerialNumber().setValue(voTreatmentEquipment.getSerialNumber()); } }
public TreatmentEquipmentConfigVo save(TreatmentEquipmentConfigVo voTreatEquipConfig) throws StaleObjectException { if(!voTreatEquipConfig.isValidated()) throw new DomainRuntimeException("This Treatment Equipment Configuration has not been validated"); DomainFactory factory = getDomainFactory(); TreatmentEquipmentConfig doTreatEquipConfig = TreatmentEquipmentConfigVoAssembler.extractTreatmentEquipmentConfig(factory, voTreatEquipConfig); factory.save(doTreatEquipConfig); return TreatmentEquipmentConfigVoAssembler.create(doTreatEquipConfig); }
private TreatmentEquipmentConfigVo populateInstanceData() { return super.populateDataFromScreen(form.getLocalContext().getSelectedRecord()); }