0

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.

Timu
  • 59
  • 2
  • 8
  • Related: http://stackoverflow.com/q/15910848/1065197 – Luiggi Mendoza Apr 20 '13 at 14:06
  • I don't see how they are related. It did not helped me. – Timu Apr 20 '13 at 17:00
  • It is related because you retrieve info using Ajax (JSON or XML response is indifferent here, that depends on your choice) when the scroll goes to the bottom of the page (giving the infinite scroll look n' feel as you posted in your question title). – Luiggi Mendoza Apr 20 '13 at 18:23
  • Ok, well let's say I have a ` ` – Timu Apr 21 '13 at 14:11
  • How can I append the new content that is being retrieved from `HotelList.nextPage()` to ` `, without replacing the old one, just append it at the bottom of the one that was created. – Timu Apr 21 '13 at 14:13
  • Well then, you will only need the example from [``](http://showcase.omnifaces.org/components/componentIdParam) posted in my answer there. Check the example first that shows this behavior (using a JSON answer though, but it will be similar using XML). – Luiggi Mendoza Apr 21 '13 at 14:13
  • Without all the infinite scroll. To append it after command button click. – Timu Apr 21 '13 at 14:13
  • Thank you @Luiggi. After a bit of work, I finally made something here. It's not final, but results are appending. I really appreciate your support. – Timu Apr 21 '13 at 21:03

0 Answers0