In my backed application (Spring boot), I have a method who get a Pageable (page and size) when I implement my table in angular, when I pass just the page with the normal size of rows are ok, but when I change the rows it will get a random page without any reason, somebody knows if is a bug? My spring controller:
@GetMapping("/getAll")
public ResponseEntity<Page<PersonModel>> getAll(Integer page, Integer size) {
return ResponseEntity.ok(personService.personModelList(page, size));
}
My angular html:
<p-table #dt [value]="persons" dataKey="id" responsiveLayout="scroll"
currentPageReportTemplate="Showing {first} to {last} of {{totalRecords}} persons">
<ng-template pTemplate="caption">
.....
</p-table>
<p-paginator
(onPageChange)="handlePagination($event)"
[rows]="rows"
[rowsPerPageOptions]="[10,25,50]"
[totalRecords]="totalRecords"
></p-paginator>
my ts:
public handlePagination(paginationData: any): void {
console.log(paginationData)
this.currentPage = paginationData.page + 1;
this.rows=paginationData.rows;
this.getAll(this.currentPage,this.rows);
}
what I see when I just change the page: page changing
what I see when I just change the rows (it change the pages too without any reason): rows change
It shoud't get the other result of next pages without get the old result?