I have the following structure:
<div id='Content' align='center'>
<h:form class="form_wrapper">
<div id="innerContent">
<div jsfc="ui:repeat" value="#{HotelList.hotel_summary}" var="hotel" styleClass="dataTable" class="hotelWrapper">
<ui:repeat value="" var="">
....................................
</ui:repeat>
</div>
</div>
</h:form>
</div>
The inside of the innerContent
is being populated with information from an XML response. This is how I get the response for #{HotelList.hotel_summary}
:
HotelListRequest hotel_list = new HotelListRequest();
HotelListResponse response = service.getList(hotel_list);
com.ean.wsapi.hotel.v3.HotelList hl = response.getHotelList();
hotel_summary = hl.getHotelSummary();
cacheKey = response.getCacheKey();
cacheLocation = response.getCacheLocation();
I have implemented pagination, so here's the code for that:
public String nextPage(){
HotelListRequest hotel_list = new HotelListRequest();
hotel_list.setCacheKey(cacheKey);
hotel_list.setCacheLocation(cacheLocation);
HotelListResponse response = service.getList(hotel_list);
com.ean.wsapi.hotel.v3.HotelList hl = response.getHotelList();
hotel_summary = hl.getHotelSummary();
cacheKey = response.getCacheKey();
cacheLocation = response.getCacheLocation();
return "hotelResults?faces-redirect=true";
}
It's pretty much the same thing the two ones with the only difference that the last one sets the cacheKey and cacheLocation, in order to get the next bunch of data.
hotelResults.xhtml is name of the page that the data is being showed on.
I tried using Infinite Scroll From Paul Irish and Luke Shumard, but it's only working with <a href>
and with <a href>
I can't use action="#{HotelList.nextPage()}"
I also tried Infinite Scrolling from http://kahimyang.info, but with no luck.
I am looking for some insight of what do I need to change in order to make this happen. I'm assuming that the pagination I made will come in handy.
I would also want to add that I'm quite new with JSF, so I apologize if this is a stupid question, I am just stuck.