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: 8f1982f7
    Year: 1999
    Color: Yellow
  • Id: 42a01f56
    Year: 1990
    Color: Yellow
  • Id: 921f1257
    Year: 1996
    Color: Black
  • Id: 1004e03d
    Year: 2004
    Color: Green
  • Id: 7c5c92c7
    Year: 1981
    Color: White
  • Id: 60f524bb
    Year: 1984
    Color: Orange
  • Id: 53f6a3a1
    Year: 1980
    Color: Black
  • Id: fde424f9
    Year: 1969
    Color: Red
  • Id: 1edf8ab0
    Year: 1968
    Color: Green
  • Id: 097a17aa
    Year: 2005
    Color: Silver
  • Id: 1a4af705
    Year: 1985
    Color: Silver
  • Id: 00b2ec94
    Year: 1975
    Color: Brown
  • Id: d042d7d8
    Year: 2005
    Color: Silver
  • Id: fd5d60f4
    Year: 1996
    Color: Red
  • Id: eff063dd
    Year: 1989
    Color: White
  • Id: 31669346
    Year: 1997
    Color: Brown
  • Id: 2a87e33b
    Year: 1972
    Color: Green
  • Id: 6da8b048
    Year: 2006
    Color: Yellow
  • Id: 81009665
    Year: 1979
    Color: Silver
  • Id: 8a0302e1
    Year: 2006
    Color: Yellow
  • Id: 1f9e0568
    Year: 1982
    Color: White
  • Id: 790253d8
    Year: 1962
    Color: Black
  • Id: f5201a3d
    Year: 1964
    Color: Yellow
  • Id: 6a10cc24
    Year: 1984
    Color: Brown
  • Id: 65c8d0a1
    Year: 1980
    Color: Blue
  • Id: f696ab14
    Year: 1996
    Color: Black
  • Id: 37664096
    Year: 1967
    Color: White
  • Id: e933f3db
    Year: 1998
    Color: Blue
  • Id: 666b011c
    Year: 1997
    Color: Maroon
  • Id: 148f99c5
    Year: 1967
    Color: White
  • Id: b660484e
    Year: 2008
    Color: Black
  • Id: a5daa22a
    Year: 1963
    Color: Green
  • Id: d67e0da3
    Year: 1995
    Color: White
  • Id: 44903f9b
    Year: 1987
    Color: Green
  • Id: f5eb6fc1
    Year: 1991
    Color: Green
  • Id: b66a96fd
    Year: 1978
    Color: White
  • Id: 6d2dc7ba
    Year: 1992
    Color: Silver
  • Id: a5eea55f
    Year: 1966
    Color: Yellow
  • Id: af7d66b9
    Year: 1998
    Color: Orange
  • Id: 977fbbaa
    Year: 1961
    Color: Blue
  • Id: 831c8675
    Year: 1998
    Color: Orange
  • Id: 0d396f65
    Year: 1988
    Color: Brown
  • Id: 08762684
    Year: 2000
    Color: Orange
  • Id: 7aa50837
    Year: 1999
    Color: Maroon
  • Id: e5933fe2
    Year: 1968
    Color: Yellow
  • Id: 355272e4
    Year: 1975
    Color: Red
  • Id: c528f49b
    Year: 1960
    Color: Brown
  • Id: bf05473b
    Year: 1962
    Color: Maroon
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.