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"; }
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(); }
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"; }
public String get() { tank = tanks.getRowData(); return "list"; }
public String delete() { tank = tanks.getRowData(); tm.delete(tank); return "delete"; }
public String edit() { tank = tanks.getRowData(); return "edit"; }
public ListDataModel<Tank> getTanks() { tanks.setWrappedData(tm.getTanks()); return tanks; }
public String editToDoTask() { return editTask(toDoTasks.getRowData()); }
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"; }
public ListDataModel<History> getAllHistories() { histories.setWrappedData(hm.getAllHistory()); return histories; }
public String deleteSweter() { Sweter sweterToDelete = sweters.getRowData(); sm.deleteSweter(sweterToDelete); return null; }
public ListDataModel<Sweter> getAllSweters() { sweters.setWrappedData(sm.getAllSweters()); return sweters; }
public ListDataModel<Airplane> getAllAirplanes() { airplanes.setWrappedData(pm.getAllAirplanes()); return airplanes; }
public ListDataModel<Mebel> getAllMeble() { meble.setWrappedData(mm.getAllMeble()); return meble; }
public String deleteHistory() { History historyToDelete = histories.getRowData(); hm.deleteHistory(historyToDelete); return null; }
public String editDoneTask() { return editTask(doneTasks.getRowData()); }