sortBy won't Ascend or Descend on 'DataTable/sortBy'

UI Components for JSF
NOTiFY
Posts: 157
Joined: 25 May 2016, 22:57
Location: Cambridge, UK

30 Jul 2020, 19:18

I've tried with Primefaces:

Code: Select all

compile group: 'org.primefrimefaces', name: 'primefaces', version: '8.0.3'
compile group: 'org.primefrimefaces', name: 'primefaces', version: '8.0.2'
compile group: 'org.primefrimefaces', name: 'primefaces', version: '8.0.1'
compile group: 'org.primefrimefaces', name: 'primefaces', version: '7.0.15'
compile group: 'org.primefrimefaces', name: 'primefaces', version: '7.0.11'
Using 'simple':

Code: Select all

<p:dataTable id="dataTableMotorcycles"
                         value="#{nOTiFYMotorcycleController.allNOTiFYs}"
                         style="width:100%"
                         var="motorcycle"
                         scrollHeight="100%"
                         scrollWidth="100%">
with all 'sortBy':

Code: Select all

<!-- Manufacture -->
                <!-- 1 of 6  -->
                <p:column sortBy="#{motorcycle.manufacturer}" headerText="Manufacturer">
                    <h:outputText value="#{motorcycle.manufacturer}">
                    </h:outputText>
                </p:column>

                <!-- 2 of 6  -->
                <p:column sortBy="#{motorcycle.model}" headerText="Model">
                    <h:outputText value="#{motorcycle.model}">
                    </h:outputText>
                </p:column>

                <!-- 3 of 6  -->
                <p:column sortBy="#{motorcycle.typesOf}" headerText="Type">
                    <h:outputText value="#{motorcycle.typesOf}">
                    </h:outputText>
                </p:column>

                <!-- 4 of 6  -->
                <p:column sortBy="#{motorcycle.dateProductionStarted}" headerText="Year Prod. Started">
                    <div style="text-align: center;">
                        <h:outputText value="#{motorcycle.dateProductionStarted}">
                            <f:convertDateTime pattern="yyyy"/>
                        </h:outputText>
                    </div>
                </p:column>

                <!-- 5 of 6  -->
                <p:column sortBy="#{motorcycle.dateProductionEnded}" headerText="Year Prod. Ended">
                    <div style="text-align: center;">
                        <h:outputText value="#{motorcycle.dateProductionEnded}">
                            <f:convertDateTime pattern="yyyy"/>
                        </h:outputText>
                    </div>
                </p:column>

                <!-- 6 of 6  -->
                <p:column sortBy="#{motorcycle.modelYear}" headerText="Model Year">
                    <div style="text-align: center;">
                        <h:outputText value="#{motorcycle.modelYear}">
                            <f:convertDateTime pattern="yyyy"/>
                        </h:outputText>
                    </div>
                </p:column>
If I get all my (demo) of 17 (Motorcycles) Entities & can make/set them to 'Ascend or Descend'.

If I use the "entity" to select the different type of 'Manufacturer'. So 11 x 'Moto Guzzi' and 'Ascend or Descend' won't change.

Code: Select all

motorcycleList = motorcyclesEJB.getAllMotorcycles();
The only cause of it has been using: 'dataTable & sortBy' with upgraded (2020-3-28) versions of: 'Weld 3.1.4.Final & CDI 2.0'. It is though as the 'entity' is now a 'static final' to 'p:dataTable'!

It worked previously perfectly with CDI 1.1.
PrimeFace (Elite) 8.0.3
OmniFaces 3.7.1

WildFly 20.0.1.Final
Weld 3.1.4.Final & CDI 2.0
Java OpenJDK 14.0.2, Kotlin 1.3.72 & Gradle 6.5.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests