// Metodo para buscar //
  public void buscarDatos() throws Exception {
    try {
      String parameter = lbxParameter.getSelectedItem().getValue().toString();
      String value = tbxValue.getValue().toUpperCase().trim();

      Map<String, Object> parameters = new HashMap<String, Object>();
      parameters.put("parameter", parameter);
      parameters.put("value", "%" + value + "%");

      anexo3_entidadService.setLimit("limit 25 offset 0");

      List<Anexo3_entidad> lista_datos = anexo3_entidadService.listar(parameters);
      rowsResultado.getChildren().clear();

      for (Anexo3_entidad anexo3_entidad : lista_datos) {
        rowsResultado.appendChild(crearFilas(anexo3_entidad, this));
      }

      gridResultado.setVisible(true);
      gridResultado.setMold("paging");
      gridResultado.setPageSize(20);

      gridResultado.applyProperties();
      gridResultado.invalidate();

    } catch (Exception e) {
      MensajesUtil.mensajeError(e, "", this);
    }
  }
Ejemplo n.º 2
0
  public void onClick$btnSaveResource() {
    List componenttList = rowsResourceList.getChildren();
    /// List<SelectedResource> selectedResourceList;
    // Valida si hay lista de recursos en el formulario
    if (componenttList.size() > 0) {
      ResourceRow resourceRow;
      int projectResourceIndex = -1;
      ProjectResource projectResource = new ProjectResource();
      projectResource.setResourceCategoryId(this.resourceCategorySelected.getId());
      projectResource.setSelectedResourceList(new ArrayList<SelectedResource>());
      // Valida si hay recursos seleccionados en el proyecto que corresponden a la categoria
      // seleccionada
      // para eliminarlos
      if (this.project.getProjectResourceList() != null) {
        projectResourceIndex = getProjectResourceIndex(this.resourceCategorySelected.getId());
        if (projectResourceIndex >= 0) {
          ProjectResource resource =
              (ProjectResource) this.project.getProjectResourceList().get(projectResourceIndex);
          this.project.getProjectResourceList().remove(projectResourceIndex);
          this.projectMgmtService.projectUpdate(this.project);
          this.projectMgmtService.deleteprojectResource(resource);
        }
      }
      saveProjectResources(componenttList, projectResource);

      desktop.removeAttribute("currentProject");
      desktop.setAttribute("currentProject", this.project);
      grdEditResource.setVisible(false);
      btnSaveResource.setVisible(false);
    }
  }
Ejemplo n.º 3
0
  public void createResourceForm(Long categoryId) {
    resourceCategorySelected = this.projectMgmtService.getResourceCategoryById(categoryId);
    this.clearResourceForm();
    SelectedResource selectedResource;
    ResourceRow resourceRow;
    ProjectResource projectResourceFound = getProjectResource(categoryId);
    for (Resource resource : resourceCategorySelected.getResourceList()) {
      resourceRow = new ResourceRow(resource);
      rowsResourceList.getChildren().add(resourceRow);
      // Sets selected recources
      if (projectResourceFound == null) {
        continue;
      } else {
        for (int j = 0; j < projectResourceFound.getSelectedResourceList().size(); j++) {
          selectedResource = projectResourceFound.getSelectedResourceList().get(j);
          if (selectedResource.getResource().getId().compareTo(resource.getId()) == 0) {
            resourceRow.selectedResource();
            resourceRow.setSelectedValue(selectedResource.getSelectedValue());
          }
        }
      }
    }
    // Sets selected recources

    grdEditResource.setVisible(true);
    btnSaveResource.setVisible(true);
  }
Ejemplo n.º 4
0
 public void clearResourceForm() {
   // gridResourceContainer.getChildren().clear();
   grdEditResource.setVisible(false);
   rowsResourceList.getChildren().clear();
   btnSaveResource.setVisible(false);
 }