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 6088755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:01:20+00:00 2026-05-23T12:01:20+00:00

Facelet: <h:dataTable value=#{item1.zapas} var=item2 > <h:column> <h:outputText value=#{item2.hrac == null}/> <c:choose> <c:when test=#{item2.hrac ==

  • 0

Facelet:

<h:dataTable value="#{item1.zapas}" var="item2" >
    <h:column>
        <h:outputText value="#{item2.hrac == null}"/>
        <c:choose>
            <c:when test="#{item2.hrac == null}">
                <h:outputText value="X"/>
            </c:when>
            <c:when test="#{item2.hrac != null  }">
                <h:outputText value="#{item2.vysledok}"/>
            </c:when>

        </c:choose>
    </h:column>
</h:dataTable>

Output:

trueX
falseX

falseX
trueX

item.hrac is sometimes null and sometimes not null but in my choose it still choice null. So what is wrong? How can I solve it?

  • 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-05-23T12:01:21+00:00Added an answer on May 23, 2026 at 12:01 pm

    JSTL tags and JSF tags doesn’t run in sync as you’d expect from the coding. JSTL tags runs during JSF view build time only and the result is a tree of only JSF tags. JSF tags runs during view render time only and the result is a tree of only HTML elements.

    When it’s JSTL’s turn to run during view build time, the #{item2} is not available in the scope simply because JSF hasn’t run at that point.

    To overcome this, you want to use JSF rendered attribute instead. Get rid of the whole <c:choose> block and put the following in place:

    <h:outputText value="X" rendered="#{item2.hrac == null}" />
    <h:outputText value="#{item2.vysledok}" rendered="#{item2.hrac != null}" />
    

    See also:

    • <c:choose> not working in datatable
    • JSTL c:if doesn't work inside a JSF h:dataTable
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to display a custom property using facelet expression language? For example: <h:outputText value=#{contact.customTypeProperty}
I have the follwing code inside a facelet page: <h:inputNumber value=bean.property> <f:convertNumber type=currency />
I created a simple solution for expandable columns/rows with rich:datatable and rich:column, which is
Facelet code: <h:selectOneMenu id = country label = country value = #{beanController.countryResidence}> <f:selectItems value
I have Facelet component and I have backing bean for it. When I include
Why does Glassfish shows this facelets error: javax.el.ELException: /foo/client.xhtml @11,74 value=#{messageBean.messages}: javax.mail.MessagingException: Socket closed;
I am using datatable on page and using binding attribute to bind it to
I want to dynamically pick a facelet to render some item in my data
I have an h:dataTable with data generated from an ArrayList with custom object Result.
How can I use id of DataTable Component (Primefaces 2.2.1) inside Composite Component in

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.