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: c9ce34d6
    Year: 1994
    Color: Black
  • Id: 70505cf0
    Year: 1975
    Color: Yellow
  • Id: a1805590
    Year: 1962
    Color: Red
  • Id: d96faea9
    Year: 1978
    Color: Blue
  • Id: 6bffbb17
    Year: 2007
    Color: Silver
  • Id: f1157b13
    Year: 1983
    Color: Green
  • Id: 6d5ac22e
    Year: 1981
    Color: Orange
  • Id: 7f555361
    Year: 1982
    Color: Maroon
  • Id: 7cd776a9
    Year: 1997
    Color: Silver
  • Id: 1aab27db
    Year: 1996
    Color: White
  • Id: ae4d393e
    Year: 1978
    Color: Silver
  • Id: 31d1a4ea
    Year: 1977
    Color: Maroon
  • Id: c0df5867
    Year: 1966
    Color: Green
  • Id: 93b1807a
    Year: 2000
    Color: Green
  • Id: 7530d8b3
    Year: 1986
    Color: Yellow
  • Id: 098bc1c3
    Year: 1992
    Color: Yellow
  • Id: 89a385a2
    Year: 1992
    Color: White
  • Id: 6348862d
    Year: 1969
    Color: Silver
  • Id: 6155b5b7
    Year: 1979
    Color: Maroon
  • Id: 5befd403
    Year: 1995
    Color: Brown
  • Id: ad7df531
    Year: 1979
    Color: Red
  • Id: 6e4d4308
    Year: 1992
    Color: Yellow
  • Id: fe3a6466
    Year: 1975
    Color: Brown
  • Id: cf58ffb2
    Year: 2004
    Color: Orange
  • Id: 499221d2
    Year: 1964
    Color: Brown
  • Id: 2747f824
    Year: 1974
    Color: Red
  • Id: 7c3ef36e
    Year: 1960
    Color: Maroon
  • Id: 1efbb2e4
    Year: 1978
    Color: Black
  • Id: 2cd645cf
    Year: 1978
    Color: Green
  • Id: 182dfb37
    Year: 2009
    Color: Brown
  • Id: 9e9d4997
    Year: 1961
    Color: Blue
  • Id: 909694f9
    Year: 1996
    Color: Orange
  • Id: 3c39e6c9
    Year: 1969
    Color: Orange
  • Id: cccfecae
    Year: 1986
    Color: Yellow
  • Id: 47bbd72d
    Year: 1970
    Color: Red
  • Id: 5e0e6b3a
    Year: 1982
    Color: Silver
  • Id: 0daa6b8f
    Year: 2003
    Color: White
  • Id: 8c065110
    Year: 1976
    Color: Black
  • Id: 2c5278fc
    Year: 1969
    Color: Maroon
  • Id: a5a53867
    Year: 1984
    Color: Red
  • Id: 1182cd08
    Year: 1997
    Color: Green
  • Id: 0b34c99c
    Year: 1977
    Color: Brown
  • Id: 53e1d520
    Year: 2001
    Color: Maroon
  • Id: 0a931d57
    Year: 1974
    Color: Brown
  • Id: 76952a6d
    Year: 2005
    Color: Brown
  • Id: 9a439b5e
    Year: 1977
    Color: Black
  • Id: 27765793
    Year: 1999
    Color: Yellow
  • Id: a2142fb7
    Year: 1984
    Color: Blue
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.