Adding Java tags/attributes for Vaadin-Form-Item causes exception
See original GitHub issueAdding a tag/java attribute for a Vaadin-Form-Item in the Bakery-App causes a exception to be thrown:
Constructor threw exception; nested exception is java.lang.IllegalArgumentException: A component specified to use a confirm-dialog element cannot use an element with tag name vaadin-form-item
Step to reproduce:
- Edit the order-details.html form
- Find the first vaadin-form-item (the one for due-date) and give it an ID (e.g. myformitem) and check the Java checkbox.
- Start app and navigate to storefront and the exception will occur.
Not sure if this is a flow issue or bakery-app issue, however it also occurs in our own app which uses several patterns from bakery-app.,
Seen in Flow 10.0.1
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Element Properties and Attributes | Flow - Vaadin
About Attributes. Attributes are used mainly for the initial configuration of elements. Attribute values are always stored as strings.
Read more >All Classes - Vaadin
A subclass of RuntimeException which may be thrown inside Binder.Binding logic to wrap an exception caused by HasValue , validator, converter, etc.
Read more >Index (Vaadin Platform (vaadin-platform-javadoc) 14.8.14 API)
Convenience method for creating and adding a new FormItem to this layout that wraps the given field with a component as its label....
Read more >Form Layout | Components | Vaadin Docs
Form Layout allows you to build responsive forms with multiple columns, and to position input labels above or to the side of, the...
Read more >FormLayout.FormItem hidding items - Vaadin
Vaadin lets you build secure, UX-first PWAs entirely in Java. ... If you want to hide the entire form item, you can do...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is actually caused by a bug in Designer which makes it to use the wrong types for the
@Id
instance field that it creates in the Java code. That issue is tracked in https://github.com/vaadin/designer/issues/1807.It might be possible to fix the problem by manually changing the
@Id
instance field to have the right type, e.g.FormItem
in the example you’re describing.That new error message is more helpful. The problem is that
FormItem
is incompatible with@Id
because it doesn’t have a no-arg constructor. I created https://github.com/vaadin/vaadin-form-layout-flow/issues/53 to track this issue since this ticket is full of debugging information that turned out to not be directly relevant.You should be able to work around the problem for now by creating your own simple
MyFormItem extends FormItem
class that defines a no-args constructor, and then changing your@Id
definition to use that class instead.