/**
   * enlista las actividades por el estado seleccionado y el grupo actual refresca el datatable
   *
   * @param event
   */
  public void onNodeSelect(NodeSelectEvent event) {

    int j = 0;

    activi = new Actividad();
    activi.setEstado(event.getTreeNode().toString());
    actividad = consultarActividades(idusu, activi);
    actividades = new ArrayList<Actividad>();
    if (actividad.getActividads().isEmpty()) {
      actividades = null;
    }
    Grupo g = new Grupo();
    for (int i = 0; i < grupos.size(); i++) {
      if (grupos.get(i).getNombre().compareTo(GrupoPanel) == 0) {
        g = grupos.get(i);
        indice = i;
      }
    }
    while (actividad.getActividads().size() > j) {
      act = actividad.getActividads().get(j);
      if (act.getIdInstancia().getIdPeriodoGrupoProceso().getIdGrupo().getId().compareTo(g.getId())
          != 0) {
      } else {
        actividades.add(act);
      }

      j++;
    }
  }
  public void onNodeSelect(final NodeSelectEvent event) {
    // Recursive search for selected node.
    this.updateNodeForSelected(this.studentRootNode, event.getTreeNode());

    if (event.getTreeNode() != null && event.getTreeNode() instanceof StudentAcademicYearTreeNode) {
      StudentAcademicYearTreeNode treeNode = (StudentAcademicYearTreeNode) event.getTreeNode();
      if (treeNode.getAcademicYear() != null) {

        // AcademicYear academicYear = treeNode.getAcademicYear();
        // This code will be remove in future because this functionality
        // will be moved as dropdown.
        // this.studentBean.setStudentAcademicYear(academicYear);
        this.studentBean.setActiveTabIndex(0);
        this.studentBean.setViewOrNewAction(true);
        this.viewContentHandlerBean.setCurrentViewContent(ViewContentConstant.BRANCH_STUDENTS);
      }
    } else {
      this.viewContentHandlerBean.setCurrentViewContent(ViewContentConstant.BRANCH_STUDENTS);
      this.studentBean.setActiveTabIndex(0);
      this.studentBean.setViewOrNewAction(true);
    }
  }
Example #3
0
 public void onNodeSelect(NodeSelectEvent event) {
   TreeNode selectedNode = event.getTreeNode();
   TreeNode parentNode = selectedNode.getParent();
   if (parentNode != root) {
     log.info("在课程下的某个节点被选择后取得相应的班级,并加载到页面中供教师选择");
     classesForChoose = new ArrayList<>(classMap.get(parentNode.getData().toString()));
     for (Iterator<Tclass> it = classesForChoose.iterator(); it.hasNext(); ) {
       Tclass tclass = it.next();
       if (!tclass.getType().getLabel().equals(selectedNode.getData().toString())) {
         it.remove();
       }
     }
     selectedCourse = parentNode.getData().toString();
   }
 }
  /**
   * 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);
    }
  }
 public void onNodeSelect(NodeSelectEvent event) {
   FacesMessage message = new FacesMessage("Selected :" + event.getTreeNode().toString());
   FacesContext.getCurrentInstance().addMessage(null, message);
 }