public String modifyClient() throws Exception {
    // Permet de récupérer l'id du client a modifier
    client = clients.getRowData();
    clientService.findById(client.getId());

    return "client";
  }
  public String modify() throws ServiceException {

    mission = missions.getRowData();
    System.out.println("Id mission " + mission.getId());
    missionService.findById(mission.getId());
    System.out.println("Nom mission " + mission.getNom());

    return "create";
  }
예제 #3
0
  public ListDataModel getVars() {
    System.out.println("GetVars =" + lm);
    if (lm == null) {
      ArrayList<entry> l = new ArrayList<entry>();
      l.add(new entry("11"));
      l.add(new entry("22"));
      l.add(new entry("33"));
      l.add(new entry("44"));
      lm = new ListDataModel(l);

    } else {
      System.out.println("Wrapped data = " + lm.getWrappedData().getClass().getName());
      ArrayList<entry> l = (ArrayList<entry>) lm.getWrappedData();
      for (entry i : l) {
        System.out.println("d " + i);
      }
    }
    return lm;
  }
  public String deleteClient() throws Exception {
    // On recupère l'id de l'utisateur que l'on a selectionner dans le tableau il faut utiliser
    // ListDataModel
    client = clients.getRowData();

    clientService.removeById(client.getId());
    // On met un return pour ne pas avoir d'erreur dans la page xhtml car action attent un
    // string pas un void
    // On return la methode et plus la table pour primefaces
    return initListClient();
  }
  public String remove() throws Exception {
    try {
      mission = missions.getRowData();
      missionService.removeById(mission.getId());
    } catch (Exception e) {
      FacesMessage m =
          new FacesMessage(
              FacesMessage.SEVERITY_ERROR, e.getLocalizedMessage(), "Remove unsuccessful");
      facesContext.addMessage(null, m);
    }

    return initListMission();
  }
예제 #6
0
 public String vyksmas() {
   System.out.println("VYYYYYKSMAS");
   try {
     if (lm != null) {
       if (lm.isRowAvailable()) {
         System.out.println(
             "index="
                 + lm.getRowIndex()
                 + " available="
                 + lm.isRowAvailable()
                 + " data="
                 + lm.getRowData());
       } else {
         System.out.println("index=" + lm.getRowIndex() + " available=" + lm.isRowAvailable());
       }
     }
   } catch (Exception e) {
     System.out.println("Nelaime: " + e.getMessage());
     e.printStackTrace();
   }
   return null;
 }
 // Permet d'initialiser la liste qui sera utiliser dans les datatables de primefaces
 public String initListMission() throws Exception {
   missions = new ListDataModel<Mission>();
   missions.setWrappedData(missionService.findAll());
   return "/mission/list";
 }
예제 #8
0
 public String get() {
   tank = tanks.getRowData();
   return "list";
 }
예제 #9
0
 public String delete() {
   tank = tanks.getRowData();
   tm.delete(tank);
   return "delete";
 }
예제 #10
0
 public String edit() {
   tank = tanks.getRowData();
   return "edit";
 }
예제 #11
0
 public ListDataModel<Tank> getTanks() {
   tanks.setWrappedData(tm.getTanks());
   return tanks;
 }
예제 #12
0
 public String editToDoTask() {
   return editTask(toDoTasks.getRowData());
 }
예제 #13
0
 public String editWorkingTask() {
   return editTask(workingTasks.getRowData());
 }
 // Permet d'initialiser la liste qui sera utiliser dans les datatables de primefaces
 public String initListClient() throws Exception {
   clients = new ListDataModel<Client>();
   clients.setWrappedData(clientService.findAll());
   return "clients";
 }
예제 #15
0
 public ListDataModel<History> getAllHistories() {
   histories.setWrappedData(hm.getAllHistory());
   return histories;
 }
예제 #16
0
 public String deleteSweter() {
   Sweter sweterToDelete = sweters.getRowData();
   sm.deleteSweter(sweterToDelete);
   return null;
 }
예제 #17
0
 public ListDataModel<Sweter> getAllSweters() {
   sweters.setWrappedData(sm.getAllSweters());
   return sweters;
 }
예제 #18
0
 public ListDataModel<Airplane> getAllAirplanes() {
   airplanes.setWrappedData(pm.getAllAirplanes());
   return airplanes;
 }
예제 #19
0
 public ListDataModel<Mebel> getAllMeble() {
   meble.setWrappedData(mm.getAllMeble());
   return meble;
 }
예제 #20
0
 public String deleteHistory() {
   History historyToDelete = histories.getRowData();
   hm.deleteHistory(historyToDelete);
   return null;
 }
예제 #21
0
 public String editDoneTask() {
   return editTask(doneTasks.getRowData());
 }