Checking values in a datatable?

Hello,

I'm passing my datatable a CachedRowSet

I want to render or not render a certain element depending on a value from the database that is either null or contains a blob.

The following tag works perfectly, If you mouseover the button you'll see a photo.

<h:column>

<f:facet name="header"><h:outputText value="#{textbundle.orderformphoto}"/></f:facet>

<t:popup displayAtDistanceX="10" displayAtDistanceY="10">

<h:commandButton id="fotobutton" value="#{textbundle.orderformshowphoto}"/>

<f:facet name="popup">

<h:graphicImage id="foto" value="toonfoto?bierid=#{rowVar.BierNr}"/>

</f:facet>

</t:popup>

</h:column>

My problem is that I don't want to render the buttons if there is no photo. (some items just don't have a photo in the database)

I tried checking it with jstl

<c:if test="${not empty rowVar.Foto}">blabla</c:if>

but it doesn't seem to work, not a single button is displayed

However in my original page (I'm converting a normal jsp project to jsf) this does work.

Anyone an idea?

[1476 byte] By [Mohorovicica] at [2007-11-27 3:32:31]
# 1

Each component has a 'rendered' attribute where you can put a boolean expression in. If the boolean expression returns true, then the component and all it's children will be rendered.

Some examples:

<h:someComponent rendered="#{myBean.booleanValue}" />

<h:someComponent rendered="#{myBean.intValue == 3}" />

<h:someComponent rendered="#{myBean.objectValue != null}" />

<h:someComponent rendered="#{!empty myBean.collectionValue}" />

<h:someComponent rendered="#{myBean.stringValue == 'somevalue'}" />

<h:someComponent rendered="#{!myBean.booleanValue && myBean.intValue > 0}" />

Offtopic: bier is lekker ;)

BalusCa at 2007-7-12 8:35:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanks, works perfectly now :)
Mohorovicica at 2007-7-12 8:35:32 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...