question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adding Java tags/attributes for Vaadin-Form-Item causes exception

See original GitHub issue

Adding 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

Full stack trace.txt

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Legiothcommented, Jul 3, 2018

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.

0reactions
Legiothcommented, Aug 8, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found