The problem resolved
The problem was in my getter method
public DataModel getUserModel() {
if(userModel == null)
userModel = new ListDataModel();
userModel.setWrappedData(search.getUsersList());
return userModel;
}
this method was setting the wrapper everytime we call the method getUserModel.
To make it work properly, I should write the method in the same class where getUserModel() is there, which will give me the getRowData() directly.
something like:
public Object getSelectedData() {
return userModel.getRowData();
}
And I shouldn't call getUserModel() to get the current model used by the dataTable in the backing bean. It should be used only in the jsf file, to construct the table.
Regards,
Pushpa