/** * This method is called on selection of node in branch tree. * * @param event node select event. */ public void onNodeSelect(final NodeSelectEvent event) { try { // Recursive check of selected. updateNodeForSelected(this.branchNameNode, event.getTreeNode()); if ((event.getTreeNode() != null) && (event.getTreeNode() instanceof BuildingBlockTreeNode)) { final BuildingBlockTreeNode treeNode = (BuildingBlockTreeNode) event.getTreeNode(); if (treeNode.getBuildingBlock() != null) { final BuildingBlock selectedBuildingBlock = treeNode.getBuildingBlock(); if (BuildingBlockConstant.FEE_TYPE.equals(selectedBuildingBlock.getType())) { final BranchAssembly branchAssembly = this.branchAssemblyService.findBranchAssemblyByBuildingBlockIdAndBranch( selectedBuildingBlock, getBranch()); this.branchFeeBean.setBranchAssembly(branchAssembly); this.branchFeeBean.setBuildingBlock(selectedBuildingBlock); this.branchFeeBean.setLoadBranchFeeTypesFromDB(true); this.branchFeeBean.setDisplayNewBranchFeeType(false); // NavigationHandler navigationHandler = // ViewUtil.getFacesContext().getApplication() // .getNavigationHandler(); // navigationHandler.handleNavigation(ViewUtil.getFacesContext(), // null, // ViewPathConstants.ORGANIZATION_BRANCH_FEE_TYPE_PERIODICAS); } else if (BuildingBlockConstant.EXPENSE_TYPE.equals(selectedBuildingBlock.getType())) { final BranchAssembly branchAssembly = this.branchAssemblyService.findBranchAssemblyByBuildingBlockIdAndBranch( selectedBuildingBlock, getBranch()); this.branchExpenseBean.setBranchAssembly(branchAssembly); this.branchExpenseBean.setBuildingBlock(selectedBuildingBlock); this.branchExpenseBean.setLoadBranchExpenseTypesFromDB(true); // NavigationHandler navigationHandler = // ViewUtil.getFacesContext().getApplication() // .getNavigationHandler(); // navigationHandler.handleNavigation(ViewUtil.getFacesContext(), // null, // ViewPathConstants.ORGANIZATION_BRANCH_EXPENSE_TYPE_PERIODICALS); } else if (BuildingBlockConstant.DEPARTMENT.equals(selectedBuildingBlock.getType())) { final BranchAssembly branchAssembly = this.branchAssemblyService.findBranchAssemblyByBuildingBlockIdAndBranch( selectedBuildingBlock, getBranch()); this.branchDepartmentBean.setBranchAssembly(branchAssembly); this.branchDepartmentBean.setBuildingBlock(selectedBuildingBlock); this.branchDepartmentBean.setLoadBranchFeeTypesFromDB(true); // NavigationHandler navigationHandler = // ViewUtil.getFacesContext().getApplication() // .getNavigationHandler(); // navigationHandler.handleNavigation(ViewUtil.getFacesContext(), // null, // ViewPathConstants.ORGANIZATION_BRANCH_DEPARTMENTS); } } } else { this.branchBean.setActiveTabIndex(0); this.viewContentHandlerBean.setCurrentViewContent( ViewContentConstant.ORGANIZATION_BRANCHES); this.branchBean.setViewOrNewAction(true); } } catch (final ApplicationException exception) { log.info(exception.getMessage()); ViewExceptionHandler.handle(exception); } }