I'm using PrimeFaces 5.1, In my page I need dataTable width through expression,because p:columns to set column at the dataTable with greater 400px set auto otherWise set width 400px;
<p:dataTable id="cars" var="car" value="#{dtColumnsView.cars}"
widgetVar="carsTable" filteredValue="#{dtColumnsView.filteredCars}"
style="width:expression(this.Width >400 ?'auto':'400px')">
<p:columns value="#{dtColumnsView.columns}"
var="column" columnIndexVar="colIndex"
sortBy="#{car[column.property]}" filterBy="#{car[column.property]}">
..........
</p:columns>
</p:dataTable>
I need to set width through expression below width expression is not working?