Is it possible to implement live scrolling or lazy scrolling in a
loop. I have the following codes in a
Both JSTL and EL will be able only during view build time of the page (this is done by server). Ajax requests aren't part of view build time since they're in client browser, so JSTL and EL are useless to handle ajax requests. Still, you can make use of ajax with plain servlets as stated here: How to use Servlets and Ajax?
Since you're using JSF in your code (based on the use of deferred evaluation expression like #{statusBean.statusList}
and <h:form>
) and assuming you use JSF 2+, there's a good example in OmniFaces showcase: <o:componentIdParam>, the Expandable list example shows that you can make an ajax call to a @RequestScoped
managed bean and retrieve a JSON String
and use it to update values on client side like HTML dom.
Live scroll example based on this answer:
$(window).scroll(function(){
if ($(window).scrollTop() == $(document).height() - $(window).height()){
loadNewData();
}
});
function loadNewData(){
/* add code to fetch new content and add it to the DOM */
}