Bug in Crud grid

Presumably, the grid in the Crud component is supposed to display every data member that hasn’t had its column explicitly removed. That’s clearly not happening.

@Document(collection = "user")
public class User {
    @Id
    private ObjectId id;
    @Indexed(unique = true)
    private String username;
    private String password;
    private boolean isTemporaryPassword;
    private String firstName;
    private String lastName;
    private Sex sex;
    private LocalDate dateOfBirth;
    @Indexed(unique = true)
    private String email;
    private Country country;
    private State state;
    private GymAffiliation gymAffiliation;
    @DBRef
    private Gym gym;
    private Role role;
    private Binary photo;
    private LocalDate dateAdded;
    private String gymName;
public class UserDataProvider extends AbstractBackEndDataProvider<User, CrudFilter> {
    private final UserService userService;
    private final List<User> DATABASE;
    private Consumer<Long> sizeChangeListener;

    public UserDataProvider(UserService userService) {
        this.userService = userService;
        DATABASE = userService.findAll();
        for(User user : DATABASE)
            System.out.println("user.GetIsTemporaryPassword() returns: " + user.GetIsTemporaryPassword());
    }
public class UserDataProvider extends AbstractBackEndDataProvider<User, CrudFilter> {
    private final UserService userService;
    private final List<User> DATABASE;
    private Consumer<Long> sizeChangeListener;

    public UserDataProvider(UserService userService) {
        this.userService = userService;
        DATABASE = userService.findAll();
        for(User user : DATABASE)
            System.out.println("user.GetIsTemporaryPassword() returns: " + user.GetIsTemporaryPassword());
    }

18215505.png
18215508.png

Actually, there are numerous bugs and issues with the Crud component.

  1. A data member with a null value will cause an assertion error if you attempt to do a sort on the column it’s in.
  2. Double clicking on an item sometimes brings up the “New item” dialog instead of the “Edit item” dialog. Thus, there’s no delete link when that happens.
  3. The bug that’s mentioned above is apparently due to how the data member is named. A standard naming convention in Java is to begin boolean variable names with “is”. Renaming “isTemporaryPassword” to “temporaryPassword” solved the issue.
  4. The PersonDataProvider code used in the Vaadin example seems to work well for very simple POJOs. However, it can generate a null Comparator object will POJOs that contain user defined types.
  5. Calling the focus method on a component in the CrudEditor does not give the component focus.