DataView - List only

DataView displays data in grid or list layout. But you can use it to only display a list or grid.

Documentation
ui-button
  • Id: 1ace96c4
    Year: 1987
    Color: Orange
  • Id: ffb46207
    Year: 1960
    Color: Yellow
  • Id: 909359da
    Year: 1989
    Color: White
  • Id: dfba6678
    Year: 1961
    Color: Brown
  • Id: e5dabc94
    Year: 2008
    Color: Yellow
  • Id: e05c1fd4
    Year: 2006
    Color: Red
  • Id: 09fc13b1
    Year: 1996
    Color: Brown
  • Id: 628aeace
    Year: 2009
    Color: Silver
  • Id: 95187cb2
    Year: 1962
    Color: Black
  • Id: a21ea6f9
    Year: 1992
    Color: Orange
  • Id: 1a73cbb4
    Year: 1986
    Color: Brown
  • Id: 8697a84e
    Year: 1963
    Color: Red
  • Id: 11f369b0
    Year: 1988
    Color: Yellow
  • Id: 2ab81881
    Year: 1994
    Color: White
  • Id: 2d0ddafb
    Year: 1977
    Color: Blue
  • Id: 31a38055
    Year: 1998
    Color: Brown
  • Id: 4e0ede8d
    Year: 1976
    Color: Maroon
  • Id: a8848d50
    Year: 1989
    Color: Silver
  • Id: 1dba2f82
    Year: 1990
    Color: Green
  • Id: 8bb99b90
    Year: 1985
    Color: Maroon
  • Id: 89d82b16
    Year: 2008
    Color: Yellow
  • Id: c5a03d27
    Year: 1996
    Color: White
  • Id: e02989da
    Year: 1968
    Color: Black
  • Id: 1751daec
    Year: 1970
    Color: Blue
  • Id: 6771f22b
    Year: 2008
    Color: Maroon
  • Id: f7d1abf4
    Year: 1975
    Color: Maroon
  • Id: 1edd7010
    Year: 1966
    Color: White
  • Id: 8454938c
    Year: 1961
    Color: Maroon
  • Id: f49db3cf
    Year: 1960
    Color: Green
  • Id: 48821e1d
    Year: 2004
    Color: Silver
  • Id: 83e590c5
    Year: 1968
    Color: White
  • Id: b584c403
    Year: 1975
    Color: Yellow
  • Id: d7757933
    Year: 1968
    Color: Green
  • Id: 70e2798f
    Year: 2000
    Color: Black
  • Id: a18c62ff
    Year: 1992
    Color: White
  • Id: 9f6535b3
    Year: 1965
    Color: Blue
  • Id: a8821a4a
    Year: 1975
    Color: Orange
  • Id: f9ce4f2a
    Year: 2009
    Color: Green
  • Id: 911d83ac
    Year: 1993
    Color: Red
  • Id: 4477ca4c
    Year: 1983
    Color: White
  • Id: f1a6a662
    Year: 1962
    Color: Silver
  • Id: 3dc50241
    Year: 1989
    Color: Red
  • Id: d8a3f728
    Year: 1995
    Color: Brown
  • Id: de5e2fa5
    Year: 1970
    Color: Brown
  • Id: ed0419ad
    Year: 2008
    Color: Yellow
  • Id: 5c253a15
    Year: 1964
    Color: Black
  • Id: c101d467
    Year: 2007
    Color: Red
  • Id: 457cb5c8
    Year: 2001
    Color: Brown
Car Info
<style type="text/css"> 
    /*demo*/
    .ui-dataview-list .ui-dataview-row {
        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);
    }

    .logo {
        width: 5%;
    }
    .detail {
        width: 85%;
        padding-left: 25px;
    }
</style>

<h:form id="form">
    <p:dataView var="car" value="#{dataGridView.cars}" listIcon="pi pi-bars">

        <p:dataViewListItem>
            <h:panelGrid columns="3" 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>

                <p:commandLink update=":form:carDetail" oncomplete="PF('carDialog').show()" title="View Detail">
                    <h:outputText styleClass="ui-icon pi pi-search" style="margin:0 auto;" />
                    <f:setPropertyActionListener value="#{car}" target="#{dataGridView.selectedCar}" />
                </p:commandLink>
            </h:panelGrid>
        </p:dataViewListItem>
    </p:dataView>

    <p:dialog header="Car Info" widgetVar="carDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
        <p:outputPanel id="carDetail" style="text-align:center;">
            <p:panelGrid  columns="2" rendered="#{not empty dataGridView.selectedCar}" columnClasses="label,value">
                <f:facet name="header">
                    <p:graphicImage name="demo/images/car/#{dataGridView.selectedCar.brand}-big.gif"/> 
                </f:facet>

                <h:outputText value="Id:" />
                <h:outputText value="#{dataGridView.selectedCar.id}" />

                <h:outputText value="Year" />
                <h:outputText value="#{dataGridView.selectedCar.year}" />

                <h:outputText value="Color:" />
                <h:outputText value="#{dataGridView.selectedCar.color}" style="color:#{dataGridView.selectedCar.color}"/>

                <h:outputText value="Price" />
                <h:outputText value="$#{dataGridView.selectedCar.price}" />
            </p:panelGrid>
        </p:outputPanel>
    </p:dialog>
</h:form>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.