private void updateCurrentItem() { int count = getDAO().count(); if (selectedItemIndex >= count) { // selected index cannot be bigger than number of items: selectedItemIndex = count - 1; // go to previous page if last page disappeared: if (pagination.getPageFirstItem() >= count) { pagination.previousPage(); } } if (selectedItemIndex >= 0) { current = getDAO().findRange(new int[] {selectedItemIndex, selectedItemIndex + 1}).get(0); } }
public String destroy() { current = (Benefit) getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); performDestroy(); recreatePagination(); recreateModel(); return "List"; }
public String destroy(Sessionf f) { current = (Inscription) getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); performDestroy(); current.setSession(f); System.out.println("//////////////////////////////////////" + f.getInscriptions()); f.setInscriptions(getFacade().listInscrit(f)); System.out.println("+++++++lllllllllllllllllllllllllllllll" + f.getInscriptions()); recreatePagination(); recreateModel(); return "ListInscription"; }
public String prepareEdit() { current = (Benefit) getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "Edit"; }
public String prepareEdit() { current = (Registre_jugement_Deces) getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "Edit"; }
public String prepareView() { current = (Inscription) getItems().getRowData(); selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex(); return "View"; }