Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8359345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:07:03+00:00 2026-06-09T11:07:03+00:00

On a Facelets page I travel a list to display data in a p:dataTable

  • 0

On a Facelets page I travel a list to display data in a p:dataTable (a PrimeFaces component).
This list itself contains another list that I travel using a c:forEach (JSTL).

The problem is that the data for the list that c:forEach should handle does not appear. When I access a specific element it works well, but not in a c:forEach.

Is it not possible to use an inner loop variable embedded in another loop?

Here’s the page’s code:

    <?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:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./template_utilisateur.xhtml">

            <ui:define name="content">

                <h:form prependId="false" id="form">

                    <p:growl id="growl" showDetail="true"/>

                    <p:dataTable id="carsTable" var="car" value="#{histCommController.lc}" rowKey="#{car.id}"  
                                  selectionMode="single" >

                        <f:facet name="header">
                            Expand rows to see detailed information
                        </f:facet>

                        <p:column style="width:4%">
                            <p:rowToggler/>
                        </p:column>

                        <p:column style="width:48%">
                            <f:facet name="header">
                                id
                            </f:facet>
                            <h:outputText value="#{car.id}" />
                        </p:column>

                        <p:column style="width:48%">
                            <f:facet name="header">
                                date envoi
                            </f:facet>
                            <h:outputText value="#{car.dateEnvoi}" />
                        </p:column>

                        <p:rowExpansion id="expanssion">
                            <h:panelGrid id="display" columns="2" cellpadding="4" style="width:300px;"
                                         styleClass=" ui-widget-content grid">

                                <h:outputText value="Model:" />
                            <h:outputText value="#{car.id}" />

                            <h:outputText value="Year:" />
                            <h:outputText value="#{car.etat}" />

                            <h:outputText value="Manufacturer:" />
                            <h:outputText value="#{car.dateEnvoi}" />

                            <h:outputText value="Color:" />
                            <h:outputText value="#{car.dateLivraisonRecommande}" />

                            <h:outputText value="Fichiers : " />
                            <h:outputText value="::::::::::::" />


                            <h:outputText value="Fichiers 1 : " />
                            <h:outputText value="#{car.listFichiers.get(0).nom}" />


                            <c:forEach var="jjjjj" items="#{car.listFichiers}">
                                <h:outputText value="nom fichier 1 : " />
                            <h:outputText value="#{jjjjj.nom}" />
                            </c:forEach>
                            </h:panelGrid>

                        </p:rowExpansion>
                    </p:dataTable>
                </h:form>

            </ui:define>

        </ui:composition>

    </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:07:05+00:00Added an answer on June 9, 2026 at 11:07 am

    The problem occurs because you are mixing so-called build-time and render-time constructs.

    build-time happens first, and everything that happens there can not make use of things that don’t exist until render-time, which happens after.

    In your case, the JSTL forEach is build-time, while the car var is made available by the render-time dataTable. The solution is to use a render-time construct for the inner looping. The best candidate for this is ui:repeat.

    See also

    • Beware the Difference Between Build-Time and Render-Time Tags in Facelets
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to reuse a jsf page by including using facelets into another jsf
I have a Facelets Composite component that includes, among other things, a commandButton: <?xml
I'm using MyFaces 1.1.7 with Facelets and Tomahawk. When creating a regular data table,
I am using JSF2 on Facelets. I define an <ui:param> in a page: <ui:composition
I am using a page with ui:composition use on it like this <?xml version='1.0'
trying to upload a file on a facelets page using Tomahawk2.0 1.1.11. But I
I have main page that looks like this: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html
I am using JSF2.0 and facelets. How to perform sorting, filtering and page navigation
I'm using JSF 2.0 with Facelets and I want to do something like this:
Let's say that you have the following Facelet ( Using Facelets 1.1.12 ): edit_item.xhtml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.