Combobox binding not working correctly?

I’m currently facing a problem where my form doesn’t bind correctly with my entity.

My Entity has a category attribute:

    private String category;

    public @Nullable String category() {
        return this.category;

    public void category(@Nullable String category) {
        this.category = category;

Inside my form I got a ComboBox for selecting the category. It displays all existing categories and allows the creation of new ones.

final ComboBox<String> category = new ComboBox<>("Category");
        category.setItems(categories); // categories = list from db query
binder.bind(category, Entry::category, Entry::category);

When saving the entity, all values are written except for the category which stays null.

    private void validateAndSave() {
        if (!binder.validate().hasErrors()) {
            try {
                if (entry.created() == null) {
                System.out.println("Saving entry: " + entry); // DEBUG
                fireEvent(new SaveEvent(this, binder.getBean()));
            } catch (Exception e) {
      "Unable to save entry", 3000, Notification.Position.TOP_END);
        } else {
  "Invalid!", 3000, Notification.Position.TOP_END);

Saving entry: Entry{id=1, title='Title', shortDescription='Summary', description='Description', priority=Very high, status=Work in progress, category='null', created=2024-02-28T20:37:15.243710, updated=2024-02-28T20:44:00.368615700, dueDate=2024-03-02T05:00, owner='user'}

The project is open source, the code for the classes in question are:

If you enter a custom value, you have to store it yourself in the dedicated listerner, see the example code of it in the docs

Ah, so I have to add the entry to the combobox items?


Ok, I got it working, thanks for your help.

I tried that before even without looking at the wiki but it didn’t work.
Since the code was identical to the wiki, I went back a few steps and sure enough, it was my mistake. The list was immutable and I just wasn’t able to read the error correctly :man_facepalming: