Hiding a Table cell
Hi,
i have a table, with 3 cells in a row. based on a column data in the database... i want to hide or display columns (every column contains one image and an hyperlink).
can some one tell me how to hide or display a cell information
or
how to hide h:graphicImage and h:commandLink
Thanks in Advance
# 2
[nobr]Hi, Balu Thanks for reply...
but.....how to check with the database value...i am getting fom bean... is there any way to check condition in jsf?
this is my code....
<table>
<tr>
<td align="center">
<h:graphicImage value="/images/a.gif" styleClass="button" />
<br/><br/>
<h:commandLink id="appa" action="#{f.showb}" styleClass="button1" value="Continue"/>
</td>
<td>
<h:graphicImage value="/images/b.gif" styleClass="button" />
<br/> <br/>
<h:commandLink id="appb" action="#{f.showa}" styleClass="button1" value="Continue"/>
</td>
</tr>
</table>
Thanks in Advance.[/nobr]
# 3
The 'rendered' attribute accepts any EL expression with a boolean outcome.
Some basic examples:
<h:someComponent rendered="#{myBean.booleanValue}" />
<h:someComponent rendered="#{myBean.intValue > 10}" />
<h:someComponent rendered="#{myBean.objectValue == null}" />
<h:someComponent rendered="#{myBean.stringValue != 'someValue'}" />
<h:someComponent rendered="#{!empty myBean.collectionValue}" />
<h:someComponent rendered="#{!myBean.booleanValue && myBean.intValue != 0}" />
<h:someComponent rendered="#{myBean.stringValue == 'oneValue' || myBean.stringValue == 'anotherValue'}" />
I however recommend you to use a dynamically sizeable h:dataTable or a static h:panelGrid instead of a plain HTML table.
# 5
Hi Balu,
Thanks for your reply, i could solve my problem. but when i am using panelGrid to display columns, if one column is hidden...then i am missing the table layout...
<h:panelGrid columns="2">
<h:graphicImage value="/images/a.gif" rendered="#{focal.emp_access.keepAdmin =='Y' }" />
<h:graphicImage value="/images/b.gif" rendered="#{focal.emp_access.optionsAdmin =='Y' }" />
<h:commandLink id="appkeep" action="#{focal.showkeep}" value="Continue" rendered="#{focal.emp_access.keepAdmin =='Y'}"/>
<h:commandLink id="appoptions" action="#{focal.showoptions}" value="Continue" rendered="#{focal.emp_access.optionsAdmin =='Y'}"/>
</h:panelGrid>
in the above code if the second image is hidden , then i am getting the link in the first row. is there any way to control this behavior... ?