56 lines
1.6 KiB
Java
56 lines
1.6 KiB
Java
package managedbean.medicalTest;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
import javax.annotation.PostConstruct;
|
|
import javax.faces.view.ViewScoped;
|
|
import javax.inject.Named;
|
|
|
|
import org.primefaces.model.LazyDataModel;
|
|
import org.primefaces.model.SortOrder;
|
|
|
|
import TO.QuestionTO;
|
|
import managedbean.common.ManagedBeanBase;
|
|
import managedbean.common.SessionUtils;
|
|
|
|
@Named("PendingQuestions")
|
|
@ViewScoped
|
|
public class PendingQuestionsMBean extends ManagedBeanBase implements Serializable {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private int familyDoctorId;
|
|
private LazyDataModel<QuestionTO> lazyDataModelQuestionList;
|
|
|
|
public PendingQuestionsMBean() {
|
|
}
|
|
|
|
@PostConstruct
|
|
public void init() {
|
|
// Inicialización de variables y propiedades van aquí.
|
|
this.familyDoctorId = Integer.valueOf(SessionUtils.getUserId());
|
|
|
|
this.lazyDataModelQuestionList = new LazyDataModel<QuestionTO>() {
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
@Override
|
|
public List<QuestionTO> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) {
|
|
Long totalRowCount = getRemoteManagerMedicalTest().getPendingQuestionsCount(familyDoctorId);
|
|
this.setRowCount(totalRowCount.intValue());
|
|
|
|
return getRemoteManagerMedicalTest().listPendingQuestionsPaged(familyDoctorId, (first / pageSize), pageSize);
|
|
}
|
|
};
|
|
}
|
|
|
|
public LazyDataModel<QuestionTO> getLazyDataModelQuestionList() {
|
|
return lazyDataModelQuestionList;
|
|
}
|
|
|
|
public void saveData() {
|
|
|
|
}
|
|
}
|