What is the correct way to use vaadin-multi-select-combo-box and form binder?

Lets say i have the following entities on java side:

class Document {
  @NotNull
  @Nonnull
  private List<@Nonnull User> permittedUsers;
}

class User {
  @NotNull
  @Nonnull
  private String id;

  @NotNull
  @Nonnull
  private String name;
}

and an edit-mask on typescript side:

@customElement('document-editor')
export class DocumentEditor extends View {
   private readonly binder = new Binder(this, DocumentModel);
   @state() private availableUsers?: Array<User>;

   protected render(): unknown {
      const model = this.binder.model;
      return html`<vaadin-multi-select-combo-box .items="${this.availableUsers}" item-id-path="id" item-value-path="id" item-label-path="name" ${field(model.permittedUsers)}></vaadin-multi-select-combo-box>`;
}

Is this the correct way to use MultiSelectComboBox?

I ask this because i’m getting and NPE inside BinderNode.runOwnValidators because this[_validators] is used before initialization and i’m unsure if i simply use MultiSelectComboBox and/or Binder not the way it was intended or if this a bug to report.

Technically it’s implemented if you wanna look from that direction https://github.com/vaadin/hilla/issues/456

I know it’s implemented and with simpler datatypes (e.g. List) it already works. But given the example above i get an exception

Sounds like a bug / missing feature :slightly_smiling_face:

i think so too, but it’s also possible i use it the wrong way. There is not much documentation / examples about using multi-select-combo-box with the binder :slightly_smiling_face:

seems to be a bug in the binder, to me the usage looks correct. Could you, please, file a bug report issue to the Hilla repo?

sure