ColumnResizeEvent is giving me the wrong width when resizing datatable columns primefaces

I use primefaces 5.2 and jsf 2.2.6 and I get a wrong width value in the columnResizeEvent when resizing the columns.

For the datatable I use the attribute resizeMode="expand", because I want to keep the size of the other columns the same when resizing a column.

But the problem is when I want the decrease the width of a column, I get a bigger value than the previous one, even though I decreased the width and even though in the user interface the column appears to have a smaller width as I want it to be.

When I don't use the attribute resizeMode on the datatable, the provided width from the ColumnResizeEvent is correct, but the size of the other columns are changed and I don't want that.

Is there a way to resize a column and keep the sizes of the others and at the same time to get a correct value of the column width?


So, it seemed that the problem was the widgetVar from the datatable, because I had several tables with the same value in the widgetVar for every single datatable and that's why it had the same clientId, because the same clientId was added to the DOM.

To find out more about the problem and solution, you can visit another post of mine, in which I want to use the same xhtml with a datatable for multiple tabs:

How to use the same datatable for all the tabs primefaces (resize not working in this case)

Need Your Help

Call Web Services Using Ajax or Silverlight? Which performs best?

javascript ajax silverlight web-services

I'm building an ASP.NET AJAX application that uses JavaScript to call web services to get its data, and also uses Silverlights Isolated Storage to cache the data on the client machine. Ultimately o...

Select item from many-to-many table that has all these details... proper solution?

php mysql count many-to-many

(PHP/MySQL) Let me preface by saying that this works, and that I'm wondering if there's a cleaner way. This seems a bit... brutish? And I'm not known for my efficient coding. :-/