DataScroller - Basic

DataScroller displays data with on demand loading using scroll.

Scroll Down to Load More Cars
  • Id: ad95f399
    Year: 2001
    Color: White
  • Id: d4a0d611
    Year: 2001
    Color: Maroon
  • Id: 490f4592
    Year: 1970
    Color: Yellow
  • Id: cbe46785
    Year: 1999
    Color: Green
  • Id: 96186846
    Year: 1986
    Color: Blue
  • Id: fb7c8df1
    Year: 1981
    Color: Silver
  • Id: f656e681
    Year: 2002
    Color: Red
  • Id: 8acb4b91
    Year: 2006
    Color: White
  • Id: a287b8c6
    Year: 1993
    Color: Yellow
  • Id: a18a7ff5
    Year: 1964
    Color: Black
<style type="text/css">
    .logo {
        width: 5%
    }
    
    .detail {
        width: 95%;
        padding-left: 25px;
    }
    
    .detail td {
        font-size: 24px;
    }
    
    .ui-datascroller .ui-datascroller-item {
        border-bottom: 1px solid #A8A8A8;
        padding: 25px 10px;
        /* with the exported variables from Nova and Luna Themes*/
        border-bottom-color: var(--input-border-color, #A8A8A8);
    }
</style>


<h:form> 
    <p:dataScroller value="#{dataScrollerView.cars}" var="car" chunkSize="10">
        <f:facet name="header">
            Scroll Down to Load More Cars
        </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>