Skip to content

“Using a Field Strategy” documentation #4447

@leangermany

Description

@leangermany

Tell us about your request

I found an issue in this Lit Binder Field Strategy Docs. Using Vaadin 24.6.12.

When overriding the getFieldStrategy method and no model?: AbstractModel is given to the super call, the Checkbox value binding is broken. Changing the value in the form does result in a wrong value put in the bean:

  • true/checked is false
  • false/not checked is undefined

Suggested change in the documentation would be:

  override getFieldStrategy(element: any, model?: AbstractModel): FieldStrategy {
    if (element.localName === 'my-text-field' && model instanceof StringModel) {
      return new MyTextFieldStrategy(element);
    }
-  return super.getFieldStrategy(element);
+  return super.getFieldStrategy(element, model);
  }
}

If you think this issue is important, add a 👍 reaction to help the community and maintainers prioritize this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions