JSTL c:if doesn't work inside a JSF h:dataTable

Viewed 29699

I'm trying to use <c:if> to conditionally put a <h:outputLink> inside a <h:dataTable> when the state is finished.

<h:dataTable value="#{bean.items}" var="item" width="80%">
    <h:column>
        <f:facet name="header">
            <h:outputText value="State" />
        </f:facet>

        <c:if test="#{item.state != 'Finish'}">
            <h:outputText value="Missing value" />
        </c:if>
        <c:if test="#{item.state == 'Finish'}">
            <h:outputLink value="myLink">
                <h:outputText value="Value = #{item.state}" />
            </h:outputLink>
        </c:if>
    </h:column>
</h:dataTable>

But this does not work, why is that and how can I fix it?

1 Answers
Related