Update: I realized that id=#{col.name} only works for facelets, and I am using jsp.
I'm not sure switching to Facelets would even solve your problem. I've been struggling for the last three days with similar sorting problems with the scrollableDataTable. I'm using Facelets and using an expression to render the id value is itself problematic. If I use a non-numeric expression id ("column#{idx}") the id is computed correctly but attempting to sort throws a NumberFormatException. However, if I go with a purely numeric id ("#{idx}") then no data columns are output at all - just blank rows. I had several other problems relating to using the <rich:columns> tag that I will try to describe later. For now, I've abandoned the idea of allowing the user to sort the table. I have the luxury of adding an Order By selection to the UI where they define the output columns they want. Then I just order the results within the underlying query.
I believe it should helps and here is working sample . Columns really requires mapping sortOrder to some map because them getting rebuild for every request and need to restore sorting states. And as for id - not sure what about final but in earlier versions it was required also.
It works!