Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using static inner class as itemType of a grid with HTML template #1847

Closed
tanbt opened this issue Aug 24, 2018 · 1 comment
Closed

Using static inner class as itemType of a grid with HTML template #1847

tanbt opened this issue Aug 24, 2018 · 1 comment
Assignees
Labels
BFP Warranty prioritised issue bug V8
Milestone

Comments

@tanbt
Copy link
Contributor

tanbt commented Aug 24, 2018

Steps to reproduce

  • Create a FW8 template with a grid inside a vertical-layout
  • Create an inner static class
  • in itemType property of the grid, select that static inner class
  • use that template in an UI, run the app and access the UI

Actual behavior

The UI isn't rendered and throw exception:

java.lang.IllegalArgumentException: Unable to find class org.test.mypack.MyClass.MyStaticClass
        at com.vaadin.ui.Grid.resolveClass(Grid.java:4422)
        at com.vaadin.ui.Grid.setBeanType(Grid.java:4394)
        at com.vaadin.ui.Grid.doReadDesign(Grid.java:4351)
        at com.vaadin.ui.AbstractListing.readDesign(AbstractListing.java:356)
        at com.vaadin.ui.declarative.DesignContext.readDesign(DesignContext.java:526)
        at com.vaadin.ui.declarative.DesignContext.readDesign(DesignContext.java:506)
        at com.vaadin.ui.AbstractOrderedLayout.readDesign(AbstractOrderedLayout.java:471)
        at com.vaadin.ui.declarative.DesignContext.readDesign(DesignContext.java:526)
        at com.vaadin.ui.declarative.Design.designToComponentTree(Design.java:502)
        at com.vaadin.ui.declarative.Design.read(Design.java:612)
        at org.test.MyDesign.<init>(MyDesign.java:24)

Expected behavior

The UI is rendered normally.

IDE, Designer and OS version

Eclipse and IntelliJ, Designer 2,3, all OS.

@tanbt
Copy link
Contributor Author

tanbt commented Aug 24, 2018

Workaround:
In the HTML template, grid itemType for static inner class must alway use $ for the inner class instead of ..
E.g: org.test.mypack.MyClass$MyStaticClass
instead of org.test.mypack.MyClass.MyStaticClass

And the itemType in Editor's Properties table will show org.test.mypack.MyClass.MyStaticClass, making it easier for users to type or copy/paste this class name around.

But when users connect that grid to a property in Java companion file, class name must use ..
https://vaadin.slack.com/archives/C3XABCQGK/p1535110028000100

@tanbt tanbt self-assigned this Aug 27, 2018
@tanbt tanbt closed this as completed Sep 6, 2018
@ripla ripla added the BFP Warranty prioritised issue label Sep 7, 2018
@tanbt tanbt reopened this Sep 7, 2018
@ripla ripla added this to the 3.1.2 milestone Sep 13, 2018
@ripla ripla closed this as completed Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFP Warranty prioritised issue bug V8
Projects
None yet
Development

No branches or pull requests

2 participants