Hi,
I have the below code trying to print a dataTable when the backing bean
found entries, or "no results" when none are found. But my JSTL tags don't
seem to have access to my JSF backing beans. What is the best way to combine
JSTL and JSF, or are the other JSF tags/attributes I should use for this
purpose?
My table gets printed nicely without the JSTL c:if and c:choose tags
Thank you,
joost
<h:form id="searchResults" onsubmit="return validateForm(this);">
<c:if test="#{jsp$searchResults.query!=null">
<c:choose>
<c:when test="${jsp$searchResults.hits > 0" >
<!-- only show the dataTable if there is a query -->
<t:dataTable
value="#{jsp$searchResults.hits}"
var="result"
width="100%"
styleClass="entityTable"
rowClasses="rollableDarkRow, rollableLightRow"
cellspacing="0">
<f:facet name="header">
<h:outputText value="header"/>
</f:facet>
<f:facet name="footer">
<t:dataScroller paginator="true"/>
</f:facet>
<t:column id="name" headerstyleClass="columnheader">
<f:facet name="header" >
<t:commandSortHeader columnName="name"
arrow="true" id="s1">
<h:outputText
value="#{labels['labels.item.name']}" id="h1"/>
</t:commandSortHeader>
</f:facet>
<h:outputText
value="#{labels[result.className]}"/>
</t:column>
</t:dataTable>
</c:when>
<c:otherwise>
no results
</c:otherwise>
</c:choose>
</c:if>
</h:form>