1
I have a medical care application and I have the following question: when to use the component p:autoComplete
of Primefaces to search for the name of the patient who has the attribute dataNascimento
, I want the h:outputText
get the age from the database.
<p:autoComplete id="nome"
value="#{cadastroPrimeiraConsultaBean.pessoa.nome}"
completeMethod="#{cadastroPrimeiraConsultaBean.porNome}"
var="pessoa" itemLabel="#{pessoa.nome}" itemValue="#{pessoa}"
forceSelection="true" dropdown="true" />
<p:outputLabel value="Data de Nascimento:" for="dataNascimento" />
<h:outputText value="cadastroPrimeiraConsultaBean.pessoa.dataNascimento id="dataNascimento"/>
Could you help me solve this problem.
Rafael, to do this Switch, I have to pick up the id? Example: public Pessoa porId(Long id) { Return manager.find(Person.class, id); }
– Antonio Williams
Yes, I would recommend doing by id.
– Rafael
<p:outputLabel value="Patient’s Name:" for="patient" /> <p:autocomplete placeholder="Enter patient’s name" id="patient" value="#{cadastre PrimeiraConsultaBean.primeiraConsulta.person}" completeMethod="#{cadastralPrimeiraConsultaBean.completeName}" var="patient" itemLabel="#{patient.name}" itemValue="#{patient}" forceSelection="true" dropdown="true" > <p:ajax Event="itemSelect" update="ready" process="@this" Listener="#{cadastre>
– Antonio Williams