I have a JSF data table
<h:dataTable id="memberTable" value="#{bean.pList}" border="0"
rowClasses="rowEven rowOdd" var="item">
<h:column rendered="#{item.isDisplay == Y}">
<h:outputText value="#{item.visitDate}" >
</h:outputText>
</h:column>
</datatable>
I have more such columns that are rendred based on a condition, when the condition is false and if I have the border=1; I see that blank cells are displayed. How can i display only the columns i want and have other ie. rendered=false not display blank cells?
Thanks,
Sai.
You can’t render an entire column based on the condition of a particular row. This makes technically no sense. You need to evaluate the condition based on a property of the parent bean.
Move the
public String getDisplay()method to the class behind#{bean}.Note that I also fixed some other mistakes in your EL expression. You shouldn’t prefix the property name with
isorgetand you should quote string values. You can also better make it a boolean property.with