Preguntas y respuestas funcionando para médicos
This commit is contained in:
80
1.sources/MyHealth/docroot/medicaltest/Questions.xhtml
Normal file
80
1.sources/MyHealth/docroot/medicaltest/Questions.xhtml
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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"
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
|
||||
<ui:composition template="../header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form id="frmQuestions">
|
||||
<p:growl id="msgs" showDetail="true" closable="true"
|
||||
autoupdate="true" />
|
||||
<p:panel id="panelQuestions" header="Preguntas">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-3 ui-md-3">
|
||||
<p:commandButton rendered="#{Questions.showCreate}" action="#{Questions.create}" value="Nuevo" update="panelDetail"></p:commandButton>
|
||||
<p:orderList value="#{Questions.pendingQuestions}" var="pq"
|
||||
controlsLocation="none" itemValue="#{pq}">
|
||||
<o:converter converterId="omnifaces.ListConverter"
|
||||
list="#{Questions.pendingQuestions}" />
|
||||
<p:ajax event="select" listener="#{Questions.onSelect}"
|
||||
update="panelDetail"></p:ajax >
|
||||
<p:ajax event="unselect" listener="#{Questions.onUnSelect}"
|
||||
update="panelDetail"></p:ajax>
|
||||
<p:column>
|
||||
<h:graphicImage name="images/#{pq.status}.png"
|
||||
alt="#{pq.status}" styleClass="ui-theme" />
|
||||
</p:column>
|
||||
<p:column>
|
||||
<h:outputText value="#{pq.title}" />
|
||||
</p:column>
|
||||
</p:orderList>
|
||||
</div>
|
||||
<div class="ui-g-1 ui-md-1"></div>
|
||||
<div class="ui-g-8 ui-md-8">
|
||||
<p:panel id="panelDetail" visible="#{Questions.showPanelDetail}" header="Pregunta de #{Questions.selected.patient.name} #{Questions.selected.patient.surname} ">
|
||||
<h:outputText rendered="#{Questions.selected.status != 'NEW'}">#{Questions.selected.title}</h:outputText>
|
||||
<p:inputText rendered="#{Questions.selected.status == 'NEW'}"></p:inputText>
|
||||
<p:textEditor rendered="#{Questions.selected.status == 'NEW'}" value="#{Questions.selected.message}" ></p:textEditor>
|
||||
<h:outputText rendered="#{Questions.selected.status != 'NEW'}" value="#{Questions.selected.message}" escape="false"></h:outputText>
|
||||
<p:panel rendered="#{Questions.selected.status != 'NEW'}" style="border: 0px !important;">
|
||||
<h3>Respuesta:</h3>
|
||||
<p:textEditor rendered="#{Questions.selected.status == 'PENDING'}" value="#{Questions.selected.response}"></p:textEditor>
|
||||
<h:outputText rendered="#{Questions.selected.status == 'ANSWERED'}" value="#{Questions.selected.response}" escape="false"></h:outputText>
|
||||
</p:panel>
|
||||
<br/>
|
||||
<p:commandButton rendered="#{Questions.selected.status != 'ANSWERED'}" value="#{Questions.selected.status == 'NEW' ? 'Preguntar' : 'Responder'}" action="#{Questions.save}" update="frmQuestions" icon="pi pi-save" ></p:commandButton>
|
||||
</p:panel>
|
||||
<!--
|
||||
<p:panel id="panelDetail" visible="#{Questions.showPanelDetail}" header="Pregunta de #{Questions.selected.patient.name} #{Questions.selected.patient.surname} ">
|
||||
<h:div rendered="#{Questions.selected.status == 'NEW'}">
|
||||
<p:inputText rendered="#{Questions.selected.status == 'NEW'}" aria-placeholder="Título de la pregunta"></p:inputText>
|
||||
<p:textEditor rendered="#{Questions.selected.status == 'NEW'}" value="#{Questions.selected.message}" ></p:textEditor>
|
||||
<br/>
|
||||
<p:commandButton rendered="#{Questions.selected.status == 'NEW'}" value="Preguntar" action="#{Questions.save}" update="frmQuestions" icon="pi pi-save" ></p:commandButton>
|
||||
</h:div>
|
||||
|
||||
<h:div rendered="#{Questions.selected.status != 'NEW'}">
|
||||
<h:h3 rendered="#{Questions.selected.status != 'NEW'}">#{Questions.selected.title}</h:h3>
|
||||
<h:outputText rendered="#{Questions.selected.status != 'NEW'}" value="#{Questions.selected.message}" escape="false"></h:outputText>
|
||||
<p:panel visible="#{Questions.selected.status != 'NEW'}" style="border: 0px !important;">
|
||||
<h3>Respuesta:</h3>
|
||||
<p:textEditor rendered="#{Questions.enableResponseEditor}" value="#{Questions.selected.response}"></p:textEditor>
|
||||
<h:outputText visible="#{Questions.enableResponseOutput}" value="#{Questions.selected.response}" escape="false"></h:outputText>
|
||||
</p:panel>
|
||||
<br/>
|
||||
<p:commandButton rendered="#{Questions.selected.status != 'NEW'}" value="Responder" action="#{Questions.save}" update="frmQuestions,listQuestions" icon="pi pi-save" ></p:commandButton>
|
||||
</h:div>
|
||||
</p:panel>
|
||||
-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
</html>
|
||||
Reference in New Issue
Block a user