I am currently having a minor problem with the rendered attribute of column in my dataTable using PrimeFaces 4.0. I have a column in my table which should not always be displayed, so I used its rendered attribute and fetching the value from my backing bean. This is the 6th and last column. The dataTable is inside a p:dialog which will be shown at the end of the method.
The rendered attribute seems to work correctly because when showColumn is false, the column will not be shown and vice versa, but there's an issue. As seen in the image, the "No records found." message can't seem to reach until the last column. When I try to remove the rendered attribute, or manually set it to true (not using the backing bean value), the "No records found." message will reach until the last column as expected.
The entire dialog/form containing these elements seem to be updated correctly after the ajax request.
Backing Bean method:
public void getStatus(final MyClass foo, boolean showColumn) {
updateForm(foo);
setShowColumn(showColumn);
RequestContext.getCurrentInstance().execute("dailyStatus.show();");
}
Column Portion in xhtml:
<p:column headerText="Problematic Column" styleClass="tablecenter" rendered="#{myMBean.showColumn}">
<p:commandLink id="view"
action="#{myMBean.doSomething}" update="@form"
rendered="#{obj.status.equals('FAILED')? 'true' : 'false'}"
onclick="spin_start()" oncomplete="spin_stop()">
<h:graphicImage name="images/restart.png" styleClass="icon" />
</p:commandLink>
</p:column>
As Displayed on the Table: