0
<p:panelGrid 
columns="2"         
style="width:800px;">

<c:forEach var="var" items="#{actividadBean.tipoEquipos}" >
    <p:row>
    <p:column>
        <h:outputText value="#{var.id}" />
    </p:column>

    <p:column>
        <h:outputText value="#{var.nombre}" />
    </p:column>
    </p:row>
</c:forEach>

</p:panelGrid> 

renders both id and nombre (name) in one cell, not in two.

thanks

demonz demonz
  • 641
  • 1
  • 15
  • 32
  • do not mix JSF and JSTL tags. simplest thing is to use a `` and `` for ``
    – Michele Mariotti Feb 04 '14 at 01:15
  • @Michele: Please stop spreading this "do not mix JSF with JSTL" meaningless drivel dating from old days. We're not in 2004 anymore. In the meanwhile, carefully read http://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense/3343681#3343681 – BalusC Feb 04 '14 at 06:46
  • @demonz: just remove the ``. This is not making sense in this specific context. It'll then work as you intented. Whether that's the *right* solution for the concrete requirement is however a different problem. – BalusC Feb 04 '14 at 06:47
  • @BalusC i heave read it, i'll stop spreading and start using it. you are many steps forward, as usual. and, as usual, thanks for sharing your knowlegde. priceless. – Michele Mariotti Feb 04 '14 at 09:22

1 Answers1

2

The c: tag is a JSP - Standard Tag Library tag which wont support with prime-face. You can use

<p:dataTable var="var" value="#{actividadBean.tipoEquipos}">
        <p:column>
        <h:outputText value="#{var.id}" />
    </p:column>

    <p:column>
        <h:outputText value="#{var.nombre}" />
    </p:column> 
</p:dataTable>

Else you can also use simple HTML tags

<c:forEach var="var" items="#{actividadBean.tipoEquipos}" >
   <tr>
       <td> <h:outputText value="#{var.id}" />
    </td>
    <td>
        <h:outputText value="#{var.nombre}" />
    </td>
   </tr>
</c:forEach>
Dileep
  • 5,362
  • 3
  • 22
  • 38
  • I will remove the downvote once you explain in proper technical terms the reasoning behind your first statement. – BalusC Feb 04 '14 at 06:47
  • @BalusC I don't exactly know what really causes the issue, i too had theses kind of issues earlier. When i searched for the details i found that there are some issue with the #{ tag used and also some says that the engine wont detect the JSF codes inside the JSTL tags. – Dileep Feb 04 '14 at 07:10
  • 2
    Well, the downvote stays. The statement *"The c: tag is a JSP - Standard Tag Library tag which wont support with prime-face"* is namely wrong. Carefully read http://stackoverflow.com/questions/3342984/jstl-in-jsf2-facelets-makes-sense/3343681#3343681 to learn how/what JSTL is actually to be used for. – BalusC Feb 04 '14 at 07:33
  • 1
    @BalusC Now i get..!! Thanks teacher :D But before making an edit i need to have a clarification, as described in the link above, c:forEach will iterate at first, ie; at view build time. Then it will be generating a set of p:rows with two p:colums inside which is must be working fine. So how does removing the p:row fix the issue here..?? – Dileep Feb 04 '14 at 08:45