DataScroller - Loader

A custom component can be used instead to load data on demand instead of the scroll event.

Scroll Down to Load More Cars
  • Id: e2deccf4
    Year: 1974
    Color: Silver
  • Id: a6e0ce55
    Year: 1988
    Color: White
  • Id: 711ff20f
    Year: 1982
    Color: White
  • Id: 612a50ab
    Year: 2004
    Color: Maroon
  • Id: 48090d22
    Year: 1968
    Color: Red
  • Id: 7217ce17
    Year: 1975
    Color: Maroon
  • Id: 264bb0cc
    Year: 1989
    Color: Brown
  • Id: f9a6348c
    Year: 2009
    Color: Maroon
  • Id: 1acdac10
    Year: 2005
    Color: Brown
  • Id: ad1f2501
    Year: 1969
    Color: Green
<h:form> 
    <p:dataScroller value="#{dataScrollerView.cars}" var="car" chunkSize="10">
        <f:facet name="header">
            Scroll Down to Load More Cars
        </f:facet>

        <f:facet name="loader">
            <p:commandButton type="button" value="More" icon="ui-icon-circle-triangle-s"/>
        </f:facet>

        <h:panelGrid columns="2" style="width:100%" columnClasses="logo,detail">
            <p:graphicImage name="demo/images/car/#{car.brand}-big.gif" /> 

            <p:outputPanel>
                <h:panelGrid columns="2" cellpadding="5">
                    <h:outputText value="Id:" />
                    <h:outputText value="#{car.id}" style="font-weight: bold"/>

                    <h:outputText value="Year:" />
                    <h:outputText value="#{car.year}" style="font-weight: bold"/>

                    <h:outputText value="Color:" />
                    <h:outputText value="#{car.color}" style="font-weight: bold"/>
                </h:panelGrid>
            </p:outputPanel>
        </h:panelGrid>
    </p:dataScroller>
</h:form>