private void populateScreenFromData(DrivingVo voDriving) { form.getLocalContext().setDrivingVo(voDriving); if(voDriving.getAuthoringCPIsNotNull()){ form.qmbAuthoringCP().newRow(voDriving.getAuthoringCP(), voDriving.getAuthoringCP().toString()); form.qmbAuthoringCP().setValue(voDriving.getAuthoringCP()); } if(voDriving.getAuthoringDateTimeIsNotNull()) form.dtimAuthoring().setValue(voDriving.getAuthoringDateTime()); GenForm.grdDrivingRow rowDriving = null; if(voDriving.getDrivingAspectIsNotNull()) for (int i = 0; i< voDriving.getDrivingAspect().size(); i++) { DrivingAspectVo voDrivingAspect = voDriving.getDrivingAspect().get(i); rowDriving = form.grdDriving().getRows().newRow(); rowDriving.setColDriving(voDrivingAspect.getAspect()); if(voDrivingAspect.getStatusIsNotNull()) rowDriving.setColStatus(voDrivingAspect.getStatus()); if(voDrivingAspect.getCommentIsNotNull()) rowDriving.setColComments(voDrivingAspect.getComment()); } if(voDriving.getDrivingCommencedDateIsNotNull()) form.pdtDrivingStart().setValue(voDriving.getDrivingCommencedDate()); if(voDriving.getVehicleTypeIsNotNull()) form.txtTypeOfVehicle().setValue(voDriving.getVehicleType()); if(voDriving.getSpecialistInfoEquipIsNotNull()) form.txtSpecialistInfo().setValue(voDriving.getSpecialistInfoEquip()); }
private DrivingVo populateDataFromScreem(DrivingVo voDriving) { if(voDriving.getCareContext() == null) voDriving.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); voDriving.setAuthoringCP(form.qmbAuthoringCP().getValue()); DateTime dateTime = form.dtimAuthoring().getValue(); if(dateTime!=null){ if(form.dtimAuthoring().getValue().getDate()==null){ engine.showMessage("Please enter Date."); return null; } if(form.dtimAuthoring().getValue().getTime()==null){ engine.showMessage("Please enter Time."); return null; } } voDriving.setAuthoringDateTime(dateTime); DrivingAspectVoCollection collDrivingAspectVo = new DrivingAspectVoCollection(); GenForm.grdDrivingRow rowDriving = null; for (int i = 0; i< form.grdDriving().getRows().size(); i++) { rowDriving = form.grdDriving().getRows().get(i); DrivingAspectVo voDrivingAspect = new DrivingAspectVo(); voDrivingAspect.setAspect(rowDriving.getColDriving()); voDrivingAspect.setStatus(rowDriving.getColStatus()); voDrivingAspect.setComment(rowDriving.getColComments()); collDrivingAspectVo.add(voDrivingAspect); } voDriving.setDrivingAspect(collDrivingAspectVo); voDriving.setDrivingCommencedDate(form.pdtDrivingStart().getValue()); voDriving.setVehicleType(form.txtTypeOfVehicle().getValue()); voDriving.setSpecialistInfoEquip(form.txtSpecialistInfo().getValue()); return voDriving; }