Versión inicial página de gestión de especialidades
This commit is contained in:
@@ -2,54 +2,26 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||||
xmlns:p="http://primefaces.org/ui">
|
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||||
|
|
||||||
<ui:composition template="../header.xhtml">
|
<ui:composition template="../header.xhtml">
|
||||||
<ui:define name="content">
|
<ui:define name="content">
|
||||||
<h:form id="TestForm">
|
<h:form id="frmManageSpecialties">
|
||||||
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
<p:messages id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||||
<p:panel id="PanelUnderConstruction" header="Pagina en construcción de Administrador">
|
<p:panel id="PanelMS" header="Página Gestión de Especialidades">
|
||||||
<div class="ui-g ui-fluid">
|
<div class="ui-g ui-fluid">
|
||||||
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:outputLabel for="campo" value="Etiqueta para campo de formulario:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:inputText id="campo" value="Valor del campo del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:message for="campo" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:outputLabel for="campo2" value="Etiqueta para campo 2 de formulario:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:inputText id="campo2" value="Valor del campo 2 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:message for="campo" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:outputLabel for="campo3" value="Etiqueta para campo 3 de formulario:" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:inputText id="campo3" value="Valor del campo 3 del formulario" required="true" requiredMessage="Por favor, especifique un valor" />
|
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4">
|
|
||||||
<p:message for="campo" display="text" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="ui-g-12 ui-g-nopad">
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-2 ui-md-2">
|
||||||
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{BeanName.actionMethod}" icon="pi pi-check" />
|
<p:autoComplete id="specialty" dropdown="true" required="true"
|
||||||
|
value="#{SystemAdmin.medicalSpecialty}" completeMethod="#{SystemAdmin.completeMedicalSpecialty}" var="ms"
|
||||||
|
placeholder="----- Selecciona una especialidad -----" itemLabel="#{ms.name}" itemValue="#{ms.name}" forceSelection="true">
|
||||||
|
<o:converter converterId="omnifaces.ListConverter" list="#{RegisterUser.medicalSpecialtiesList}" />
|
||||||
|
<p:column>
|
||||||
|
<h:outputText value="#{ms.name}" />
|
||||||
|
</p:column>
|
||||||
|
</p:autoComplete>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui-g-2 ui-md-2">
|
<div class="ui-g-4 ui-md-4">
|
||||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
<p:message for="specialty" />
|
||||||
</div>
|
|
||||||
<div class="ui-g-4 ui-md-4" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p:panel>
|
</p:panel>
|
||||||
|
|||||||
@@ -1,28 +1,71 @@
|
|||||||
package managedbean.systemAdmin;
|
package managedbean.systemAdmin;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.faces.application.FacesMessage;
|
||||||
import javax.inject.Named;
|
import javax.inject.Named;
|
||||||
|
|
||||||
|
import TO.LoggedUserTO;
|
||||||
|
import TO.MedicalSpecialtyTO;
|
||||||
|
import common.Constants;
|
||||||
|
import common.UserType;
|
||||||
import managedbean.common.ManagedBeanBase;
|
import managedbean.common.ManagedBeanBase;
|
||||||
|
import managedbean.common.SessionUtils;
|
||||||
|
|
||||||
@Named("SystemAdminMBean")
|
@Named("SystemAdmin")
|
||||||
@RequestScoped
|
@RequestScoped
|
||||||
public class SystemAdminMBean extends ManagedBeanBase implements Serializable {
|
public class SystemAdminMBean extends ManagedBeanBase implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private String lastUIQuery;
|
||||||
|
private MedicalSpecialtyTO medicalSpecialty;
|
||||||
|
private List<MedicalSpecialtyTO> medicalSpecialitiesList;
|
||||||
|
|
||||||
public SystemAdminMBean() {
|
public SystemAdminMBean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void init() {
|
public void init() {
|
||||||
// Inicialización de variables y propiedades van aquí.
|
// Recuperamos el usuario logeado actual
|
||||||
|
LoggedUserTO usr = null;
|
||||||
|
this.lastUIQuery = "";
|
||||||
|
|
||||||
// Como realizar llamadas al EJB Remoto
|
try {
|
||||||
// this.getRemoteManagerSystemAdmin().MetodoEJB
|
usr = SessionUtils.getloggedOnUser();
|
||||||
|
|
||||||
|
if (usr == null)
|
||||||
|
this.addFacesMessage(FacesMessage.SEVERITY_ERROR, "Sesión no válida",
|
||||||
|
"Su sesión actual no es válida, por favor cierre su sesión y vuelva a logearse en el sistema.");
|
||||||
|
else {
|
||||||
|
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesPaged(0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.manageException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<MedicalSpecialtyTO> getMedicalSpecialtiesList() {
|
||||||
|
return medicalSpecialitiesList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MedicalSpecialtyTO> completeMedicalSpecialty(String query) {
|
||||||
|
if (query != null && query.equals(this.lastUIQuery) == false) {
|
||||||
|
this.lastUIQuery = query;
|
||||||
|
// Recuperamos las 200 primeras coincidencias
|
||||||
|
this.medicalSpecialitiesList = this.getRemoteManagerCommon().listMedicalSpecialitiesFiltered(query, 0, Constants.MAX_ITEMS_AUTOCOMPLETE_SEARCH);
|
||||||
|
}
|
||||||
|
return this.medicalSpecialitiesList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MedicalSpecialtyTO getMedicalSpecialty() {
|
||||||
|
return medicalSpecialty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMedicalSpecialty(MedicalSpecialtyTO value) {
|
||||||
|
this.medicalSpecialty = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user