Link to home
Start Free TrialLog in
Avatar of srikotesh
srikotesh

asked on

pagenation issue in java

Hi Experts,

I am calling wsdl service and getting 137 records
now i want to get only 10 records each time
when i request with
http://localhost:8080/reportlist?pagenum=1&recordcount=10

i am getting 10 records
next time when i tried with
http://localhost:8080/reportlist?pagenum=2&recordcount=10 
i am  not getting the values


        }
if(recordcount != null){            
            reportListingInput.setStartlimit((recordcount * pagenum) - (recordcount - 1));
            reportListingInput.setPagelimit(recordcount);

Open in new window


please find the attachment to see the code

Thanks
SAMPLE_CODE.txt
Avatar of Am P
Am P
Flag of India image

Avatar of srikotesh
srikotesh

ASKER

index I'd need to change
when I start with pagenum 2
result of json index starts with 11 ends with 20.
when I am iterating json index always I am initialising with 1

index should start with 11
ASKER CERTIFIED SOLUTION
Avatar of Am P
Am P
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I have made changes as per my above comments its working fine now
Perfect.

Could you please post the solution so that it can be referred in future for similar situation ? A brief description of the solution will do.
sorry i am unable to post my code
sorry i am unable to post my code:

this is the line which is giving  page start limit value properly
if(recordcount != null){            
            reportListingInput.setStartlimit((recordcount * pagenum) - (recordcount - 1));
            reportListingInput.setPagelimit(recordcount);
        }

in another method i hard coded index value starts with 1
so when i click next page 10*2-10-1--->it has to start from 11
but i have hardcode as 1 due to that issue came.
GOOD