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: 39e10e25
    Year: 1970
    Color: Orange
  • Id: 3d2fbeb1
    Year: 2007
    Color: Brown
  • Id: e1f39ee9
    Year: 1998
    Color: Red
  • Id: 96d95c4d
    Year: 1979
    Color: Silver
  • Id: ad5baa30
    Year: 1998
    Color: Blue
  • Id: 62464259
    Year: 1991
    Color: Orange
  • Id: addfc703
    Year: 2000
    Color: Silver
  • Id: 05efc2b8
    Year: 1993
    Color: Yellow
  • Id: 1d8c0b37
    Year: 1997
    Color: Orange
  • Id: 7f84a9c6
    Year: 1965
    Color: Yellow
  • Id: d4c35133
    Year: 2003
    Color: Brown
  • Id: a04c5780
    Year: 2001
    Color: Maroon
  • Id: cfcac3f3
    Year: 1997
    Color: Orange
  • Id: a4d7bda7
    Year: 1990
    Color: Black
  • Id: 80e972e1
    Year: 1975
    Color: Blue
  • Id: 7259fde0
    Year: 1996
    Color: Yellow
  • Id: 1561eb72
    Year: 1990
    Color: Orange
  • Id: 2b490440
    Year: 1969
    Color: Green
  • Id: 27368cbc
    Year: 1973
    Color: Red
  • Id: c2e57940
    Year: 1976
    Color: Yellow
  • Id: 875bae72
    Year: 1988
    Color: Orange
  • Id: 8d82fc3a
    Year: 1976
    Color: Green
  • Id: d0154567
    Year: 2001
    Color: Maroon
  • Id: 1225e590
    Year: 2001
    Color: Brown
  • Id: c2cd43d5
    Year: 2001
    Color: Orange
  • Id: ef39df00
    Year: 1987
    Color: Red
  • Id: 83764a33
    Year: 2003
    Color: Green
  • Id: db32f842
    Year: 1970
    Color: Yellow
  • Id: 18a31812
    Year: 1973
    Color: Brown
  • Id: 6b97a319
    Year: 1999
    Color: Maroon
  • Id: ab075e10
    Year: 1995
    Color: Silver
  • Id: 9b345d78
    Year: 1986
    Color: White
  • Id: c4ee0198
    Year: 1988
    Color: Red
  • Id: 2857a91d
    Year: 1967
    Color: Green
  • Id: 5f8b367f
    Year: 1989
    Color: Silver
  • Id: 20d002d7
    Year: 1981
    Color: Red
  • Id: 8898b633
    Year: 1980
    Color: Brown
  • Id: 7db14934
    Year: 1995
    Color: Yellow
  • Id: 058efc9f
    Year: 1999
    Color: Yellow
  • Id: 3c457bed
    Year: 1991
    Color: Blue
  • Id: 82f7b42d
    Year: 1983
    Color: Maroon
  • Id: b5df7483
    Year: 1987
    Color: Silver
  • Id: 5e7b3d39
    Year: 2009
    Color: Brown
  • Id: 86efff4c
    Year: 1989
    Color: Brown
  • Id: 14a1fbe4
    Year: 1994
    Color: Maroon
  • Id: d9ed6b95
    Year: 1970
    Color: Red
  • Id: ab24c833
    Year: 2004
    Color: Red
  • Id: 133e9516
    Year: 2003
    Color: White
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.