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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:45:14+00:00 2026-06-07T19:45:14+00:00

There is any possible to restrict the data display in the datable based on

  • 0

There is any possible to restrict the data display in the datable based on c:if .

Let say

Output shown now:

Startdate     end date   status    Edit

2012-02-02    2012-03-02 Waiting   edit

2012-02-03    2012-03-04 Approved   edit

Output Expected:

Startdate     end date   status    Edit

2012-02-02    2012-03-02 Waiting   edit

2012-02-03    2012-03-04 Approved  

When the status is Waiting then the edit link should be shown.when it is rejected or approved then the edit link should not be shown

This is my Xhtml file.

           <h:form>
      <h:dataTable value="#{employeeleave}" var="e"
            styleClass="order-table"
            headerClass="order-table-header"
            rowClasses="order-table-odd-row,order-table-even-row"
            columnClasses="order-table-odd-column,order-table-even-column"
        >

        <h:column>
            <f:facet name="header">
                Start Date
            </f:facet>
                #{e.startDate}
        </h:column>

        <h:column>
            <f:facet name="header">
                End Date
            </f:facet>
                #{e.endDate}
        </h:column>

        <h:column>
            <f:facet name="header">
                Reason
            </f:facet>
                #{e.reason}
        </h:column>

        <h:column>
            <f:facet name="header">
                Status
            </f:facet>
                #{e.status}
        </h:column>
            <h:column>
        <f:facet name="header">
            Edit
        </f:facet>
        <c:if test="${e.status == 'Waiting'}">
        <p:commandLink value="Edit" action="editLeave" id="editleave" >
        <f:setPropertyActionListener value="#{e}" target="#{employeeDetails.employeeLeaveSelected}" />
        </p:commandLink>
        </c:if>
        </h:column>
    </h:dataTable>  
    </h:form>
  • 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-07T19:45:16+00:00Added an answer on June 7, 2026 at 7:45 pm

    JSTL tags doesn’t work that way. They runs during view build time, not during view render time which is what you seem to expect. The ${e} is not available during view build time and would in your particular case thus always resolve to null.

    You need to use the JSF component’s rendered attribute instead.

    Replace

    <c:if test="${e.status == 'Waiting'}">
        <p:commandLink value="Edit" action="editLeave" id="editleave" >
            <f:setPropertyActionListener value="#{e}" target="#{employeeDetails.employeeLeaveSelected}" />
        </p:commandLink>
    </c:if>
    

    by

    <p:commandLink value="Edit" action="editLeave" id="editleave" rendered="#{e.status == 'Waiting'}">
        <f:setPropertyActionListener value="#{e}" target="#{employeeDetails.employeeLeaveSelected}" />
    </p:commandLink>
    

    See also:

    • JSTL in JSF2 Facelets… makes sense?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For a json data as below is there any possible way to construct a
Is there any possible way to send the html form data to java application
Is there any possible to connect .NET app with PHP? I means, PHP will
Is there any possible way to achieve this? For instance, I have an I/O
Is there any possible way of adding class and id attributes in form_dropdown of
Is there any possible way to edit this code <asp:LoginName ID=LoginName1 runat=server style=top: 165px;
Is there any possible way to PLAY a you tube video on page load
Is there any possible way to apply more than CSS to a control through
Is there any way to (robustly) reset any possible :after and :before CSS rules
Possible Duplicate: Overriding the power button in Android Is there any possible way I

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.