[bug] JPagination fix: Wrong pagination when used a multiple instances. Fixes #4521.
[imp] Add unit test for #4521.