private void setUpdatedChild() { // Straight child update - Select the currently being updated child as the one so show - post save if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo) { form.getLocalContext().setUpdatedChild((AreaOfNeedsNotingDetailVo) form.gridNotes().getValue()); } else { // Find the most recently added child if (form.getLocalContext().getUpdatingParent().equals(Boolean.FALSE)) { form.getLocalContext().getSelectedParentInstance().getNotingDetails().sort(); form.getLocalContext().setUpdatedChild( form.getLocalContext().getSelectedParentInstance().getNotingDetails().get( form.getLocalContext().getSelectedParentInstance().getNotingDetails().size() - 1)); } } }
private void populateChildCollectionFromGrid(AreaOfNeedsNotingVo voAreaOfNeedsNoting) { if(form.gridNotes().getValue() == null) return; if(voAreaOfNeedsNoting.getNotingDetails() == null) voAreaOfNeedsNoting.setNotingDetails(new AreaOfNeedsNotingDetailVoCollection()); GenForm.gridNotesRow parentRow = form.gridNotes().getValue() instanceof AreaOfNeedsNotingVo ? form.gridNotes().getSelectedRow() : form.gridNotes().getSelectedRow().getParentRow(); if (parentRow.getRows().size() > 0 ) voAreaOfNeedsNoting.getNotingDetails().clear(); for (int i=0; i < parentRow.getRows().size(); i++) { voAreaOfNeedsNoting.getNotingDetails().add((AreaOfNeedsNotingDetailVo) parentRow.getRows().get(i).getValue()); } }
private boolean newChildNode(AreaOfNeedsNotingDetailVo voNotingDetail) { if (form.getLocalContext().getSelectedChildInstance() != null) return false; if (voNotingDetail.countFieldsWithValue() >= 1) { String strErrors[] = voNotingDetail.validate(); if(strErrors != null && strErrors.length > 0) { engine.showErrors(strErrors); return true; } promoteChild(voNotingDetail); clearChildInstanceControls(); } return false; }
private void populateChildNode(gridNotesRow childRow, AreaOfNeedsNotingDetailVo voNotingDetail) { if(voNotingDetail == null) return; if(voNotingDetail.getAreaofNeed() != null) childRow.setColAreaofNeed(voNotingDetail.getAreaofNeed().toString()); if(voNotingDetail.getSummaryNote() != null && voNotingDetail.getTherapyNote() != null) childRow.setColNotes("Summary Note: " + voNotingDetail.getSummaryNote() + "\n" + "Therapy Note: " + voNotingDetail.getTherapyNote()); else if(voNotingDetail.getSummaryNote() != null && voNotingDetail.getTherapyNote() == null) childRow.setColNotes("Summary Note: " + voNotingDetail.getSummaryNote()); else if(voNotingDetail.getTherapyNote() != null && voNotingDetail.getSummaryNote() == null) childRow.setColNotes("Therapy Note: " + voNotingDetail.getTherapyNote()); childRow.setValue(voNotingDetail); if(voNotingDetail.getID_AreaofNeedsNotingDetail() == null) childRow.setTextColor(Color.Red); }
private void showHeaderOrDetailsTab() { if (form.getMode().equals(FormMode.VIEW)) { // In view mode just show the selected node if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingVo) form.ctnTherapy().lyrTherapy().showtabHeader(); else if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingVo) form.ctnTherapy().lyrTherapy().showtabHeader(); else if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo) form.ctnTherapy().lyrTherapy().showtabDetails(); else form.ctnTherapy().lyrTherapy().showtabEmpty(); } else { if (form.getLocalContext().getUpdatingParent().equals(Boolean.TRUE)) form.ctnTherapy().lyrTherapy().showtabHeader(); else form.ctnTherapy().lyrTherapy().showtabDetails(); } }
private void setDetailsTabVisibility() { if (form.getMode().equals(FormMode.VIEW)) { // In view mode, make the details tab visible if a detail instance is selected in the hierarchy grid. form.ctnTherapy().lyrTherapy().tabDetails().setHeaderVisible(form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo); } else { // In edit mode, make the details tab visible if a hierarchy item has been selected and we're not // editing a parent. form.ctnTherapy().lyrTherapy().tabDetails().setHeaderVisible(form.getLocalContext().getSelectedParentInstanceIsNotNull() && form.getLocalContext().getUpdatingParent().equals(Boolean.FALSE)); //fixCombo(); setAddApplyCaption(); } enableDetailsButtons(); }
private void getSelectedInstance() { if(form.getMode().equals(FormMode.EDIT)) { updateContextMenusState(); return; } if(form.gridNotes().getValue() instanceof AreaOfNeedsNotingVo) { form.getLocalContext().setSelectedParentInstance((AreaOfNeedsNotingVo) form.gridNotes().getValue()); populateParentInstanceControls(form.getLocalContext().getSelectedParentInstance()); } else if(form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo) { form.getLocalContext().setSelectedChildInstance((AreaOfNeedsNotingDetailVo) form.gridNotes().getValue()); populateChildInstanceControls(form.getLocalContext().getSelectedChildInstance()); } if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()) form.getLocalContext().setGoldenInstanceSelected(new Boolean(form.getLocalContext().getSelectedParentInstance().getClinicalContact().getID_ClinicalContact().equals(form.getGlobalContext().Core.getCurrentClinicalContact().getID_ClinicalContact()))); updateControlsState(); }
private String getNotes() { AreaOfNeedsNotingDetailVoCollection voAreaOfNeedsDetailColl = form.getLocalContext().getSelectedParentInstance().getNotingDetails(); if(voAreaOfNeedsDetailColl == null) return null; boolean summaryNoteExists = false; java.lang.StringBuffer notes = new java.lang.StringBuffer(""); notes.append(ims.framework.controls.RichTextControl.IdentityTag); for(int t=0; t<voAreaOfNeedsDetailColl.size(); t++) { AreaOfNeedsNotingDetailVo voAreaOfNeedDetail = voAreaOfNeedsDetailColl.get(t); //WDEV-2290 if(voAreaOfNeedDetail.getSummaryNoteIsNotNull() && voAreaOfNeedDetail.getAreaofNeedIsNotNull()) { notes.append("<font color=\"#FF0000\"><b>"); notes.append(voAreaOfNeedDetail.getAreaofNeed().toString()); notes.append("</b></font><br> "); notes.append(voAreaOfNeedDetail.getSummaryNote()); notes.append("<br>"); summaryNoteExists = true; } } if(!summaryNoteExists) { engine.showMessage("At least one Summary note must be entered. Please update a detail."); return null; } return notes.toString(); }
private void setAddApplyCaption() { form.ctnTherapy().lyrTherapy().tabDetails().btnOkDetails().setText("Add"); if (form.getLocalContext().getSelectedChildInstance() == null && (form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo)) form.ctnTherapy().lyrTherapy().tabDetails().btnOkDetails().setText("Apply"); }
private void updateInstance() { form.getLocalContext().setUpdatingParent(new Boolean(form.gridNotes().getValue() instanceof AreaOfNeedsNotingVo)); if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo) { AreaOfNeedsNotingDetailVo voCachedChild = (AreaOfNeedsNotingDetailVo) form.gridNotes().getValue(); if ( voCachedChild.getID_AreaofNeedsNotingDetail() == null) { populateChildInstanceControls(voCachedChild); } } form.setMode(FormMode.EDIT); }
private void populateChildInstanceControls(AreaOfNeedsNotingDetailVo voAreaOfNeedsNotingDetail) { if (voAreaOfNeedsNotingDetail == null ) return; form.ctnTherapy().lyrTherapy().tabDetails().cmbAreaNeed().setValue(voAreaOfNeedsNotingDetail.getAreaofNeed()); form.ctnTherapy().lyrTherapy().tabDetails().txtSummNote().setValue(voAreaOfNeedsNotingDetail.getSummaryNote()); form.ctnTherapy().lyrTherapy().tabDetails().txtTherapyNote().setValue(voAreaOfNeedsNotingDetail.getTherapyNote()); }
private void newInstance() { // New instance has been invoked for a parent instance with no current selection made OR // with a parent that is not the Golden node.. if (form.gridNotes().getValue() == null || ((form.getLocalContext().getSelectedParentInstanceIsNotNull() ) && form.getLocalContext().getGoldenInstanceSelected().equals(Boolean.FALSE))) { newParentInstance(); form.setMode(FormMode.EDIT); return; } // New instance has been invoked with a child node selected. if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo) { newChildInstance(); form.setMode(FormMode.EDIT); return; } if(form.gridNotes().getValue() != null && form.gridNotes().getSelectedRow() != null && form.getLocalContext().getSelectedParentInstanceIsNotNull()) { clearChildInstanceControls(); form.getLocalContext().setSelectedChildInstance(null); form.gridNotes().setValue(form.gridNotes().getSelectedRow().getValue()); form.gridNotes().getSelectedRow().setExpanded(true); form.setMode(FormMode.EDIT); return; } }
private void updateContextMenusState() { form.getContextMenus().hideAllGenericGridMenuItems(); if (form.getGlobalContext().Core.getCurrentClinicalContactIsNotNull()) { if(form.getLocalContext().getGoldenInstanceSelected().booleanValue()) { if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo) form.getContextMenus().getGenericGridUpdateItem().setText("Edit Area of Need Detail"); form.getContextMenus().getGenericGridAddItem().setText("Add Area of Need Detail"); form.getContextMenus().getGenericGridUpdateItem().setVisible((form.getMode().equals(FormMode.VIEW)&& form.gridNotes().getSelectedRowIndex()>=0) || (form.getMode().equals(FormMode.EDIT) && form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo && ((AreaOfNeedsNotingDetailVo)form.gridNotes().getValue()).getID_AreaofNeedsNotingDetail() == null)); if (form.gridNotes().getValue() instanceof AreaOfNeedsNotingVo) form.getContextMenus().getGenericGridUpdateItem().setVisible(false); } else { form.getContextMenus().getGenericGridAddItem().setText("New Area of Need"); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); } form.getContextMenus().getGenericGridAddItem().setVisible(form.getMode().equals(FormMode.VIEW)); form.getContextMenus().getGenericGridRemoveItem().setVisible(form.getMode().equals(FormMode.EDIT) && form.gridNotes().getValue() instanceof AreaOfNeedsNotingDetailVo && ((AreaOfNeedsNotingDetailVo)form.gridNotes().getValue()).getID_AreaofNeedsNotingDetail() == null); } }