DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: e9226793
    Year: 2005
    Color: Orange
  • Id: cdfe99ab
    Year: 1990
    Color: Blue
  • Id: ad862610
    Year: 1966
    Color: Green
  • Id: 2cd2e299
    Year: 2008
    Color: Orange
  • Id: 580ea27b
    Year: 1997
    Color: Blue
  • Id: fc9c8f26
    Year: 1967
    Color: Silver
  • Id: a786cf87
    Year: 2000
    Color: Orange
  • Id: cc32d94d
    Year: 1977
    Color: Red
  • Id: b57e7659
    Year: 2001
    Color: Silver
  • Id: 921f3286
    Year: 1965
    Color: Red
  • Id: 2dd39f9a
    Year: 2003
    Color: Green
  • Id: 174b0c23
    Year: 1971
    Color: Maroon
  • Id: abff2a7b
    Year: 1997
    Color: Brown
  • Id: 048280d3
    Year: 1989
    Color: Blue
  • Id: 32ae40ce
    Year: 1984
    Color: Black
  • Id: 2d013996
    Year: 2006
    Color: Silver
  • Id: d2f62003
    Year: 1984
    Color: Yellow
  • Id: 9d54213c
    Year: 1985
    Color: Maroon
  • Id: 129c001b
    Year: 1962
    Color: Green
  • Id: 89c93456
    Year: 1984
    Color: Blue
  • Id: 1b070e20
    Year: 1994
    Color: Brown
  • Id: 6ea6714f
    Year: 1988
    Color: White
  • Id: bec34270
    Year: 1971
    Color: Brown
  • Id: e8b0d1ed
    Year: 1962
    Color: Orange
  • Id: ad01bcfc
    Year: 1991
    Color: Yellow
  • Id: aaf1db83
    Year: 1960
    Color: Brown
  • Id: 992c6025
    Year: 1985
    Color: Maroon
  • Id: 9106a249
    Year: 1965
    Color: Orange
  • Id: 24738a4b
    Year: 2005
    Color: Black
  • Id: 5c139618
    Year: 1986
    Color: Blue
  • Id: c9a1f8f1
    Year: 1971
    Color: Brown
  • Id: a0bf36f3
    Year: 1994
    Color: Silver
  • Id: d630450d
    Year: 1966
    Color: Blue
  • Id: 592828b0
    Year: 1971
    Color: White
  • Id: e5bd6b1e
    Year: 2005
    Color: Black
  • Id: d115058f
    Year: 1996
    Color: Green
  • Id: 5d3e41f2
    Year: 1984
    Color: Orange
  • Id: c639959f
    Year: 1969
    Color: Green
  • Id: 73a11e71
    Year: 1984
    Color: Maroon
  • Id: 81087755
    Year: 1962
    Color: Black
  • Id: 58d32955
    Year: 1997
    Color: Orange
  • Id: 33a84914
    Year: 1984
    Color: Brown
  • Id: 77f178b5
    Year: 1994
    Color: Green
  • Id: e3c3c1cd
    Year: 1998
    Color: White
  • Id: fe65da95
    Year: 1987
    Color: Orange
  • Id: fbb099da
    Year: 1998
    Color: Yellow
  • Id: 6d892a8c
    Year: 1983
    Color: Brown
  • Id: 8d9a2c98
    Year: 1963
    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}"
                gridIcon="pi pi-th-large" listIcon="pi pi-bars">

        <p:dataViewGridItem>
            <p:panel header="#{car.id}" style="text-align:center">
                <h:panelGrid columns="1" style="width:100%">
                    <p:graphicImage name="demo/images/car/#{car.brand}.gif"/> 

                    <h:outputText value="#{car.brand}" />

                    <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:panel>
        </p:dataViewGridItem>

        <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.