JARCH SHOWCASE
JARCH SHOWCASE
DataTable - Dynamic Columns Columns of datatable can be created dynamically using the p:columns component.
Available columns are "id","brand","year","color" and "price".
IDBRANDYEAR
f02b7835BMW1964
0971b160Jaguar1985
bd48aea2Renault1968
f8d06452Fiat1977
2939b327BMW1998
0d810cbdMercedes1982
b28114c1Volvo2009
7a309ca3Ford1980
aefcdc63BMW1982
b20663a1Fiat1980
<a:form id="form">
    <h:panelGrid columns="3" style="margin:10px 0">
        <a:outputLabel for="template" value="Template:" style="font-weight:bold"/>
        <a:inputText id="template" value="#{dtColumnsView.columnTemplate}" size="50"/>
        <a:commandButton update="cars" actionListener="#{dtColumnsView.updateColumns}" value="Update" process="@parent" icon="ui-icon-refresh" oncomplete="PF('carsTable').clearFilters()"/>
    </h:panelGrid>

    <a:dataTable id="cars" var="car" value="#{dtColumnsView.cars}" widgetVar="carsTable" filteredValue="#{dtColumnsView.filteredCars}">
        <a:columns value="#{dtColumnsView.columns}" var="column" columnIndexVar="colIndex" sortBy="#{car[column.property]}" filterBy="#{car[column.property]}">
            <f:facet name="header">
                <h:outputText value="#{column.header}" />
            </f:facet>
            <h:outputText value="#{car[column.property]}" />
        </a:columns>
    </a:dataTable>
</a:form>
                
JARCH, Copyright © 2022 All rights reserved. Running JARCH 24.3.0-SNAPSHOT on PrimeFaces-12.0.0 on Mojarra-2.3.13.