I'm using both JSF 2.0 and jQuery/javaScript, where needed.
I'm trying to add and remove column from a datatable in a dynamic manner. Problem is - As far as I know I have to re-render the entire table to add or remove columns and that entails a fetch for all the data in the table when in fact, in most cases it isn't neccessary.
For example (typing this for the purpose of problem illustration, syntax errors might exist but assume they don't):
<h:dataTable id="table">
<h:column id="cul1" rendered="#{mrBean.isCul1_rendered} >
...
</h:column>
<h:column id="cul2" rendered="#{mrBean.isCul2_rendered} >
...
</h:column>
</h:dataTable>
<f:ajax render="table" />
<h:commandButton action="#{mrBean.switchIsCul1}" >Switch Cul1</h:commandButton>
<h:commandButton action="#{mrBean.switchIsCul2}" >Switch Cul2</h:commandButton>
</f:ajax>
As illustrated, when rendering and un-rendering a column, the whole table gets re-rendered. Is there a way to only render the changing column? (As far As i know, render="cul1
, won't work)
Thanks!