DataView - Basic

DataView displays data in grid or list layout.

Documentation
ui-button
ui-button
  • Id: b6b6024d
    Year: 1985
    Color: Yellow
  • Id: 6a623d9d
    Year: 1985
    Color: Orange
  • Id: dff028a3
    Year: 1960
    Color: Black
  • Id: 5f789268
    Year: 1962
    Color: White
  • Id: a1e6ed24
    Year: 2006
    Color: Red
  • Id: 86ed0ced
    Year: 1997
    Color: Silver
  • Id: 7d38ebbf
    Year: 1995
    Color: Silver
  • Id: 00067a81
    Year: 2003
    Color: Green
  • Id: 0293c656
    Year: 2008
    Color: Orange
  • Id: 20b1894d
    Year: 1967
    Color: Silver
  • Id: 76cb82fb
    Year: 1979
    Color: Red
  • Id: e7d7029c
    Year: 2005
    Color: Black
  • Id: 64037d05
    Year: 1986
    Color: Brown
  • Id: a444efe1
    Year: 1991
    Color: Red
  • Id: 2f3d4676
    Year: 1994
    Color: Silver
  • Id: 71ca7495
    Year: 1974
    Color: Red
  • Id: 907f7522
    Year: 1995
    Color: Red
  • Id: c1db8248
    Year: 1967
    Color: Orange
  • Id: 7ece000f
    Year: 1991
    Color: Blue
  • Id: 16f18c02
    Year: 2005
    Color: Black
  • Id: 203d9482
    Year: 1980
    Color: White
  • Id: 2abd8d14
    Year: 1965
    Color: Green
  • Id: 5ce2e7dc
    Year: 2002
    Color: Silver
  • Id: 2573aaf9
    Year: 1962
    Color: Red
  • Id: db0272fb
    Year: 1966
    Color: Silver
  • Id: 17d0b7d0
    Year: 2008
    Color: Green
  • Id: 2b53be3b
    Year: 1972
    Color: Brown
  • Id: f7170724
    Year: 1979
    Color: Brown
  • Id: 7a7f9e35
    Year: 1967
    Color: Silver
  • Id: 38a838a5
    Year: 1993
    Color: Black
  • Id: 38964b0d
    Year: 1989
    Color: Red
  • Id: 8b283980
    Year: 1997
    Color: Green
  • Id: 84cb990a
    Year: 1969
    Color: Brown
  • Id: 8998a030
    Year: 1990
    Color: Green
  • Id: ad880171
    Year: 1977
    Color: Red
  • Id: 9ce6468e
    Year: 1982
    Color: White
  • Id: a24a3252
    Year: 1983
    Color: White
  • Id: 47b5e7d5
    Year: 1961
    Color: Orange
  • Id: b05e5567
    Year: 2009
    Color: Maroon
  • Id: e6f635b3
    Year: 1990
    Color: Silver
  • Id: afe93354
    Year: 2008
    Color: Blue
  • Id: 4fcee692
    Year: 1988
    Color: Green
  • Id: 0618eac2
    Year: 2009
    Color: Brown
  • Id: 8aa00c49
    Year: 1966
    Color: Black
  • Id: e31fe3c7
    Year: 1989
    Color: Black
  • Id: 771d4532
    Year: 1993
    Color: Brown
  • Id: 07b55663
    Year: 1979
    Color: Red
  • Id: e4d394d4
    Year: 1972
    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}"
                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.