how to fill a table horizontally in primefaces?

1

I have the following table

<p:dataTable id="consultaIncidencia" styleClass="columns" var="incidenciaDet" style="max-width:3000px;max-height:770px;" value="#{RegistroAccesoComponent.incidenciaAnioMesDet}">
  <p:columnGroup type="header">
    <p:row>
      <p:column headerText="RFC" styleClass="columns" style="width:110px;height:50px" />
      <p:column headerText="Nombre" styleClass="columns" style="width:110px;height:50px" />
      <p:column headerText="Clave" styleClass="columns" style="width:110px;height:50px" />
      <ui:repeat value="#{RegistroAccesoComponent.listDias}" var="dia">
        <p:column headerText="#{dia}" />
      </ui:repeat>

    </p:row>
  </p:columnGroup>
  <p:column styleClass="columns">
    <h:outputText />
  </p:column>
  <p:column styleClass="columns">
    <h:outputText />
  </p:column>
  <p:column styleClass="columns">
    <h:outputText />
  </p:column>
  <p:columns value="#{RegistroAccesoComponent.listDias}" var="dia" styleClass="columns">
    <h:outputText />
  </p:columns>

</p:dataTable>

and I have the following code, in which I send my inquiry

    incidenciaAnioMesDet = anioMesDetService.findIncidenciaAnioMesDeByAnioMes(2018, 1, cvePersona);
   for(IncidenciaAnioMesDet incidencia: incidenciaAnioMesDet)
        System.out.println("PRUEBA" + " DIA-" +incidencia.getDia() + " INCIDENCIA-" + incidencia.getIncidencias().getCveIdIncidencia());

and throws the following in console:

PROOF DIA-3 INCIDENCIA-3
PROOF DAY-4 INCIDENCE-4, PROOF DAY-5 INCIDENCE-5
PROOF DIA-2 INCIDENCE-15
PROOF DAY-1 INCIDENCE-1

Now what I want is that this incidence number show it in the day number that says but inside my table, but nothing appears to me

How can I show that info I want in the part

                                 
                                <p:columns value="#{RegistroAccesoComponent.listDias}" var="dia" styleClass="columns">
                                    <h:outputText />
                                </p:columns>
    
asked by Root93 19.02.2018 в 17:34
source

1 answer

0

What you have to do to be able to show the information of your list in the table is to use a variable with which you can access the list and its attributes.

In your case you already have it is var="incidenciaDetvar="incidenciaDet

<p:dataTable id="consultaIncidencia" styleClass="columns" 
var="incidenciaDet" style="max-width:3000px;max-height:770px;" value="# 
{RegistroAccesoComponent.incidenciaAnioMesDet}">

The table would be this way I only put it as an example incidenciaDet.dia because what attributes has your object

<p:dataTable id="consultaIncidencia" styleClass="columns" 
var="incidenciaDet" style="max-width:3000px;max-height:770px;" value="#
{RegistroAccesoComponent.incidenciaAnioMesDet}">

<p:columnGroup type="header">
  <p:row>
   <p:column headerText="RFC" styleClass="columns" style="width:110px;height:50px" />
  <p:column headerText="Nombre" styleClass="columns" style="width:110px;height:50px" />
  <p:column headerText="Clave" styleClass="columns" style="width:110px;height:50px" />
  <ui:repeat value="#{RegistroAccesoComponent.listDias}" var="dia">
    <p:column headerText="#{dia}" />
  </ui:repeat>
</p:row>

 </p:columnGroup>
 <p:column styleClass="columns">
 <h:outputText value="#{incidenciaDet.dia} />
 </p:column>
 <p:column styleClass="columns">
 <h:outputText value="#{incidenciaDet.dia} />
 </p:column>
 <p:column styleClass="columns">
 <h:outputText value="#{incidenciaDet.dia} />
 </p:column>
 <p:columns value="#{incidenciaDet}" var="dia" styleClass="columns">
 <h:outputText />
 </p:columns>
</p:dataTable>
    
answered by 19.02.2018 в 18:16