I'd like to show a list of values that were read from database and will be shown by display tag of Struts to the user, that list of values should be loaded at the same time user scrolls down the page.
My problem is:
As I already have an action that loads just only a few data, now I was thinking of doing the load using $.ajax()
function of jQuery, but before trying something like that, I would like to know if there is an option of doing that using other Struts tag or something. (I'm using display tag just because I need sorting.)
Loading data on scroll isn't so complicated using jQuery Ajax. Below is the code used to demonstrate
scroll
event via calling$.ajax()
to load data from the Struts action which returns additional content at the end of the scrollbar thumb. Credits to the author of the article Load Data From Server While Scrolling Using jQuery AJAX.LoadDataAction.java
:LoadData.jsp
: