Input Style

Free Themes

Built-in component themes created by the PrimeFaces Theme Designer.

Saga Saga
Vela Vela
Arya Arya

Legacy Free Themes

Luna Amber Luna Amber
Luna Blue Luna Blue
Luna Green Luna Green
Luna Pink Luna Pink
Nova Nova
Nova Nova Alt
Nova Nova Accent

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.

DragDrop DataTable

DragDrop components have special integration with data components. Drag the products using the drag icon to the drop area.

Available Products
CodeNameCategoryQuantity
f230fh0g3Bamboo WatchAccessories24
nvklal433Black WatchAccessories61
zz21cz3c1Blue BandFitness2
244wgerg2Blue T-ShirtClothing25
h456wer53BraceletAccessories73
av2231fwgBrown PurseAccessories0
bib36pfvmChakra BraceletAccessories5
mbvjkgip5Galaxy EarringsAccessories23
vbb124btrGame ControllerElectronics2
Selected Products
Drop here
Product Detail

<script type="text/javascript">
    function handleDrop(event, ui) {
        var droppedProduct = ui.draggable;

        droppedProduct.fadeOut('fast');
    }
</script>

<div class="card">
    <h:form id="productForm">
        <h5 class="p-mt-0">Available Products</h5>
        <p:dataTable id="availableProducts" var="product" value="#{dndProductsView.products}">
                <p:column style="width:20px">
                    <h:outputText id="dragIcon" styleClass="ui-icon pi pi-plus"/>
                    <p:draggable for="dragIcon" revert="true" helper="clone"/>
                </p:column>

                <p:column headerText="Code">
                    <h:outputText value="#{product.code}"/>
                </p:column>

                <p:column headerText="Name">
                    <h:outputText value="#{product.name}"/>
                </p:column>

                <p:column headerText="Category">
                    <h:outputText value="#{product.category}"/>
                </p:column>

                <p:column headerText="Quantity">
                    <h:outputText value="#{product.quantity}"/>
                </p:column>
            </p:dataTable>

        <p:fieldset id="selectedProducts" legend="Selected Products" style="margin-top:20px">
            <p:outputPanel id="dropArea">
                <h:outputText value="Drop here" rendered="#{empty dndProductsView.droppedProducts}"
                              style="font-size:1.5rem"/>
                <p:dataTable id="selectedProductsTable" var="product" value="#{dndProductsView.droppedProducts}"
                             rendered="#{not empty dndProductsView.droppedProducts}">
                    <p:column headerText="Code">
                        <h:outputText value="#{product.code}"/>
                    </p:column>

                    <p:column headerText="Name">
                        <h:outputText value="#{product.name}"/>
                    </p:column>

                    <p:column headerText="Category">
                        <h:outputText value="#{product.category}"/>
                    </p:column>

                    <p:column headerText="Quantity">
                        <h:outputText value="#{product.quantity}"/>
                    </p:column>

                    <p:column style="width:32px">
                        <p:commandButton update=":productForm:display" oncomplete="PF('productDialog').show()"
                                         icon="pi pi-search">
                            <f:setPropertyActionListener value="#{product}"
                                                         target="#{dndProductsView.selectedProduct}"/>
                        </p:commandButton>
                    </p:column>
                </p:dataTable>
            </p:outputPanel>
        </p:fieldset>

        <p:droppable for="selectedProducts" tolerance="touch" activeStyleClass="ui-state-highlight"
                     datasource="availableProducts" onDrop="handleDrop">
            <p:ajax listener="#{dndProductsView.onProductDrop}" update="dropArea availableProducts"/>
        </p:droppable>

        <p:dialog header="Product Detail" widgetVar="productDialog" resizable="false" draggable="false"
                  showEffect="fade" hideEffect="fade" modal="true">
            <p:outputPanel id="display">
                <p:column rendered="#{not empty dndProductsView.selectedProduct}">
                    <div class="product">
                        <div class="product-grid-item card" style="margin-bottom: 0">
                            <div class="product-grid-item-top">
                                <div>
                                    <i class="pi pi-tag product-category-icon"/>
                                    <span class="product-category">#{dndProductsView.selectedProduct.category}</span>
                                </div>
                                <span class="product-badge status-#{dndProductsView.selectedProduct.inventoryStatus.name().toLowerCase()}">#{dndProductsView.selectedProduct.inventoryStatus.text}</span>
                            </div>
                            <div class="product-grid-item-content">
                                <p:graphicImage
                                        name="demo/images/product/#{dndProductsView.selectedProduct.image}"/>
                                <div class="product-name">#{dndProductsView.selectedProduct.name}</div>
                                <div class="product-description">#{dndProductsView.selectedProduct.description}</div>
                                <p:rating readonly="true" value="#{dndProductsView.selectedProduct.rating}"/>
                            </div>
                            <div class="product-grid-item-bottom">
                                <h:outputText value="#{dndProductsView.selectedProduct.price}"
                                              styleClass="product-price">
                                    <f:convertNumber currencySymbol="$" type="currency"/>
                                </h:outputText>
                                <p:commandButton value="Add To Cart" icon="pi pi-shopping-cart"
                                                 disabled="#{dndProductsView.selectedProduct.inventoryStatus == 'OUTOFSTOCK'}">
                                </p:commandButton>
                            </div>
                        </div>
                    </div>
                </p:column>
            </p:outputPanel>
        </p:dialog>
    </h:form>
</div>