Cambiadas todas las listas deplegables fijas, a listas con búsqueda AJAX
integrada (Estilo typeahead). Permite búsquedas en tiempo real. * Se muestra información organizada por columnas de datos. * Identificadores basados en Ids autogenerados. * Nuevos métodos en EJB común para poder realizar búsquedas de datos con filtro y paginadas (para los comboBox). * Varias correcciones de interfaz de usuario. * Nueva clase de utilidades.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package managedbean.profile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.faces.application.FacesMessage;
|
||||
@@ -11,6 +11,7 @@ import javax.inject.Named;
|
||||
import TO.FamilyDoctorTO;
|
||||
import TO.LoggedUserTO;
|
||||
import TO.PatientTO;
|
||||
import common.Constants;
|
||||
import common.UserType;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
@@ -28,7 +29,8 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
||||
private int id;
|
||||
private FamilyDoctorTO currentFamilyDoctor;
|
||||
private FamilyDoctorTO newFamilyDoctor;
|
||||
private Collection<FamilyDoctorTO> familyDoctorList;
|
||||
private List<FamilyDoctorTO> familyDoctorList;
|
||||
private String lastUIQuery;
|
||||
|
||||
public ChangeFamilyDoctorMBean() {
|
||||
|
||||
@@ -38,6 +40,7 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
||||
public void init() {
|
||||
// Recuperamos el usuario logeado actual
|
||||
LoggedUserTO usr = null;
|
||||
this.lastUIQuery = "";
|
||||
try {
|
||||
usr = SessionUtils.getloggedOnUser();
|
||||
|
||||
@@ -48,7 +51,7 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
||||
this.id = Integer.valueOf(usr.getId());
|
||||
|
||||
if (usr.getUserType() == UserType.PATIENT) {
|
||||
this.familyDoctorList = this.getRemoteManagerCommon().listAllFamilyDoctors();
|
||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
|
||||
PatientTO pat = this.getRemoteManagerCommon().retrievePatient(this.id);
|
||||
this.setCurrentFamilyDoctor(pat.getFamilyDoctor());
|
||||
@@ -60,10 +63,19 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
||||
|
||||
}
|
||||
|
||||
public Collection<FamilyDoctorTO> getFamilyDoctorList() {
|
||||
public List<FamilyDoctorTO> getFamilyDoctorList() {
|
||||
return familyDoctorList;
|
||||
}
|
||||
|
||||
public List<FamilyDoctorTO> completeFamilyDoctor(String query) {
|
||||
if (query != null && query.equals(this.lastUIQuery) == false) {
|
||||
this.lastUIQuery = query;
|
||||
// Recuperamos las 200 primeras coincidencias
|
||||
this.familyDoctorList = this.getRemoteManagerCommon().listFamilyDoctorsFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||
}
|
||||
return this.familyDoctorList;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user