user7332139
user7332139

Reputation:

Liferay SearchContainer with multiple classes

I want to make a date list with patients and doctors, in database have 1: N, and the patients is reference by the id, when i do a simple serach-container the column doctorName is null because the patient class has not a name namedDoctor , Only have idDoctor and the doctorName it owns a doctor class, so i have two classes and 1 search-container and i do not know how to put the names of doctors :/

Search-container

' emptyResultsMessage="empty-cita-menssage-result"> " total="<%= CitaLocalServiceUtil.getCitasCount() %>" /> <

<liferay-ui:search-container-row className="com.everis.formacion.model.Cita"
    keyProperty="idCita"
    modelVar="cita"
    escapedModel="<%= true %>">

    <liferay-ui:search-container-column-text
        name="fechaCita"
        property="<%= CitaPortlet.REQUEST_FECHA_PACIENTE_PARAM %>"
    />

    <liferay-ui:search-container-column-text
        name="nombrePaciente"
        property="<%= CitaPortlet.REQUEST_NOMBRE_PACIENTE_PARAM %>"
    />

    <liferay-ui:search-container-column-text 
        name="nombreDoctor"
        property="<%= DoctorPortlet.REQUEST_NOMBRE_PARAM %>"
    />

    <liferay-ui:search-container-column-text 
        name="comentarios"
        property="<%= CitaPortlet.REQUEST_COMENTARIO_PARAM %>"
    />
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />

Upvotes: 0

Views: 300

Answers (1)

user7332139
user7332139

Reputation:

    <liferay-ui:search-container-column-text
        value="<%= DoctorLocalServiceUtil.getDoctor(cita.getIdDoctor()).getNombreDoctor() %>"
        name="Nombre Doctor"
    />

with this return the name of the doctor :)

Upvotes: 1

Related Questions