public void processSelection(NodeSelectedEvent event) { try { HtmlTree tree = (HtmlTree) event.getComponent(); Department bean = (Department) tree.getRowData(); ID_ = bean.getID_(); selectRecordById(String.valueOf(ID_)); orgId = bean.getOrgId(); parentId = bean.getParentId(); orgName = bean.getOrgName(); parentName = bean.getParentName(); if (FunctionLib.isNum(getMySession().getTempStr().get("Department.move.id"))) { Query query = getSession().getNamedQuery("core.department.moverecordbyid"); query.setParameter("mId", 0); query.setParameter("orgId", orgId); query.setParameter("parentId", ID_); query.setParameter("id", getMySession().getTempStr().get("Department.move.id")); query.executeUpdate(); query = null; getMySession().getTempStr().put("Department.move.id", ""); query = getSession().createSQLQuery("CALL of_update_group(:id)"); query.setParameter("id", getMySession().getTempStr().get("Department.move.id")); query.executeUpdate(); FunctionLib.refresh(); } } catch (Exception ex) { ex.printStackTrace(); } }
/** * User selected a leaf node and is interested in its data attributes * * @param event */ public void processSelection(NodeSelectedEvent event) { HtmlTree tree = (HtmlTree) event.getComponent(); TreeNode currentNode = tree.getTreeNode(tree.getRowKey()); if (currentNode.isLeaf()) { this.setSelTreeNode(currentNode); } }