private void updateCurrentItem() {
   int count = getFacade().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 = getFacade().findRange(new int[] {selectedItemIndex, selectedItemIndex + 1}).get(0);
   }
 }
 public String destroy() {
   current = (ContaCorrente) getItems().getRowData();
   selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
   performDestroy();
   recreatePagination();
   recreateModel();
   return "List";
 }
 public String prepareEdit() {
   current = (ContaCorrente) getItems().getRowData();
   selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
   return "Edit";
 }
 public String prepareEdit() {
   current = (ParametrosGerais) getItems().getRowData();
   selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
   return "Edit";
 }
Esempio n. 5
0
 public String prepareEdit() {
   current = (Grupo) getItems().getRowData();
   selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
   return "erp_edit_grupo";
 }
Esempio n. 6
0
 public String prepareView() {
   current = (Grupo) getItems().getRowData();
   selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
   return "View";
 }