private void unassignTemplate() { TreeNode node = form.treBOList().getSelectedNode(); if(node != null && node.getParent() != null) form.getLocalContext().setLastNode((String) node.getParent().getValue()); ReportTemplateBoRefVo item = (ReportTemplateBoRefVo) form.treBOList().getValue(); try { domain.removeLink(item); open(); } catch (ForeignKeyViolationException e) { engine.showMessage("Error unassigning the template: " + e.toString()); return; } }
private void updateContextMenuStatus() { form.getContextMenus().hideAllReportTemplateBoRefMenuMenuItems(); if(form.treBOList().getValue() instanceof ReportTemplateBoRefVo) { form.getContextMenus().getReportTemplateBoRefMenuUNASSIGNItem().setVisible(true); } else if(form.treBOList().getValue() instanceof String) { String val = (String) form.treBOList().getValue(); if(val != null && val.length() > 0) { form.getContextMenus().getReportTemplateBoRefMenuASSIGNItem().setVisible(true); } } }