JPAContainer sorting

Hello!

How do sorting table “personTable” by clicking table header “department”?

thank you
15615.java (994 Bytes)
15616.java (1.7 KB)
15617.java (2.05 KB)
15618.java (1.63 KB)
15619.java (2.36 KB)

All the tables I have used already have that sorting feature enabled by default. Is that not the case for you?

Sorting table “personTable” works by clicking on “firstName”, “dateTime”, but does not work by clicking on “department”.
I solved this problem using persons.setSortProperty("department", "department.name");

You have what’s called a nested container. Perhaps you should try adding the nested properties to the container with one of these two statements right after you create the container:

persons.addNestedContainerProperty("department.name"); or this one if you just want to add all the nested properties without having to explicitly specify them:

persons.addNestedContainerProperty("department.*");