private boolean newChild(LeisureActivityOnWardVo voLeisureActivityOnWard) { if (form.getLocalContext().getActivityOnWard() != null) return false; if (voLeisureActivityOnWard.countFieldsWithValue() >= 1) { String strErrors[] = voLeisureActivityOnWard.validate(); if(strErrors != null && strErrors.length > 0) { engine.showErrors(strErrors); return true; } if(validateUI()) return true; promoteChild(voLeisureActivityOnWard); clearChildInstanceControls(); setDefaultChildValues(); } return false; }
private void populateChildInstanceControls(LeisureActivityOnWardVo voActivityOnWard) { form.qmbAuthoringCPWard().newRow(voActivityOnWard.getAuthoringCP(), voActivityOnWard.getAuthoringCP().toString()); form.qmbAuthoringCPWard().setValue(voActivityOnWard.getAuthoringCP()); form.dtimAuthoringWard().setValue(voActivityOnWard.getAuthoringDateTime()); form.dteActivity().setValue(voActivityOnWard.getActivityDate()); form.txtActivities().setValue(voActivityOnWard.getActivity()); form.txtComment().setValue(voActivityOnWard.getComment()); }
private void populateChild(grdDetailsRow childRow, LeisureActivityOnWardVo voLeisureActivityOnWard) { if (voLeisureActivityOnWard == null) return; childRow.setValue(voLeisureActivityOnWard); childRow.setColDate(voLeisureActivityOnWard.getAuthoringDateTime().getDate()); childRow.setColActivity(voLeisureActivityOnWard.getActivity()); childRow.setColComment(voLeisureActivityOnWard.getComment()); //if not saved then set the colour if(voLeisureActivityOnWard.getID_LeisureActivityOnWard() == null) childRow.setTextColor(Color.Red); }
private void populateChildInstanceData(LeisureActivityOnWardVo voLeisureActivityOnWard) { voLeisureActivityOnWard.setAuthoringCP(form.qmbAuthoringCPWard().getValue()); voLeisureActivityOnWard.setAuthoringDateTime(form.dtimAuthoringWard().getValue()); voLeisureActivityOnWard.setActivityDate(form.dteActivity().getValue()); voLeisureActivityOnWard.setActivity(form.txtActivities().getValue()); voLeisureActivityOnWard.setComment(form.txtComment().getValue()); }
private void updateInstance() { LeisureActivityOnWardVo voCachedChild = form.grdDetails().getValue(); if (voCachedChild.getID_LeisureActivityOnWard() == null) { populateChildInstanceControls(voCachedChild); form.getLocalContext().setActivityOnWard(voCachedChild); } form.dteActivity().setEnabled(true); form.txtActivities().setEnabled(true); form.txtComment().setEnabled(true); form.setMode(FormMode.EDIT); form.grdDetails().setEnabled(false); }
private void promoteUpdatedChild(LeisureActivityOnWardVo voLeisureActivityOnWard) { if (voLeisureActivityOnWard == null) return; populateChild(form.grdDetails().getSelectedRow(),voLeisureActivityOnWard); }
private void promoteChild(LeisureActivityOnWardVo voLeisureActivityOnWard) { if (voLeisureActivityOnWard == null) return; GenForm.grdDetailsRow childRow = form.grdDetails().getRows().newRow(); populateChild(childRow, voLeisureActivityOnWard); }