
Unlimited scrolling is very popular now a day. Facebook, flipkart and many more popular sites has the same functionality. It will allow you to load the data from data base and append the result in page, if there is no data available, it will show you message like – no more data available. We can set the limit of data like – every scroll how many record should be added to the page.
If you need same kind of solutions you can follow the below steps.
Step 1

Step 2

Step 3

Step 4

Step 5
Create table called country and insert the data
create table country(countryname varchar2(20),countrycode varchar2(5));
insert into country(countryname,countrycode) values(‘Afghanistan’,’93’);
insert into country(countryname,countrycode) values(‘Albania’,’355′);
insert into country(countryname,countrycode) values(‘Algeria’,’213′);
insert into country(countryname,countrycode) values(‘American Samoa’,’1684′);
insert into country(countryname,countrycode) values(‘Andorra’,’376′);
insert into country(countryname,countrycode) values(‘Angola’,’244′);
insert into country(countryname,countrycode) values(‘Anguilla’,’1264′);
insert into country(countryname,countrycode) values(‘Antarctica’,’672′);
insert into country(countryname,countrycode) values(‘India’,’91’);
insert into country(countryname,countrycode) values(‘ndonesia’,’92’);
commit;
Now run the project and take the mouse inside the div and scroll down.
Hello! thanks for your example 🙂 but i can’t download this source. Can you send for me to this my email, please
Thanks so much!
Hi Click on download code , it will take you to Github, see the right side down you will find download ZIP. it will download the code. if you are using git client you can clone the code from url (https://github.com/nirmaldhara/LoadDataWhileScrolling/)
Hi Click on download code , it will take you to Github, see the right side down you will find download ZIP. it will download the code. if you are using git client you can clone the code from url (https://github.com/nirmaldhara/LoadDataWhileScrolling/)
I was downloaded, your example very good. i am building website with java using struts. and i had a wrong when i wan to print a list of object. can you check for me? please.
the folowing is code of country.jsp
<%
out.println(" —————————————————————————–");
out.println(" “);
out.println(“${l.name} “);
out.println(“${l.code} “);
out.println(” “);
%>
Thanks you so much!!!
Can you change the country.jsp, its looks like your country .jsp having issue.you are trying to print name and code, print only name and test it.
run the country.jsp separately if output is coming then it should work with my example.
you can check below code –
0){
for(int i=0;i<countryList.size();i++){
out.println("“+countryList.get(i)+”-“+i+”“);
}
}
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
%>