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

Exception: Using converters with parameterized types is not currently supported (BigDecimalToStringEncoder) #9384

Closed
javac9 opened this issue Nov 11, 2020 · 5 comments

Comments

@javac9
Copy link

javac9 commented Nov 11, 2020

Getting this error when using BigDecimalToStringEncoder on setItems of public interface CardListViewModel extends TemplateModel { } interface.

First I put several @Encode annotations but then came this error. According to the Used in class part of the error message, it occurs in one of the interfaces my interface extends:
List<BigDecimal> getUserNumber4();
void setUserNumber4(BigDecimal... var1);

Are there plans to support Using converters with parameterized types in the near future/next releases? If not, what do you think about an annotation by which we could target and ignore the desired properties, if we can sacrifice them?

@javac9
Copy link
Author

javac9 commented Nov 12, 2020

A quick question: would trying to use CardListView with LitElement instead of Polymer make any difference here? In other words, is this lack of support of parameterized types only Polymer-specific?

@tanbt
Copy link

tanbt commented Dec 9, 2020

Hi, could you give small project that reproduces the problem?

I tried with a project from https://start.vaadin.com/ with "Card List" view but see no error when using @Encode or parameterized type List<Person>.

Using LitElement, you can't define a TemplateModel interface and have to use @Id for binding data between the template and backend-side.

@tanbt tanbt moved this from Needs triage to New P2 in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Dec 9, 2020
@tanbt tanbt moved this from New P2 to Needs triage in OLD Vaadin Flow bugs & maintenance (Vaadin 10+) Dec 9, 2020
@javac9
Copy link
Author

javac9 commented Dec 9, 2020

I didn't use Person entity but another one from a third-party API, which does have an attribute of type List<BigDecimal>.

"Using LitElement, you can't define a TemplateModel interface and have to use @id for binding data between the template and backend-side."
That seems OK for me - I don't necessarily use TemplateModel.

Do you think if I am to try with LitElement instead of Polymer, I could run into issues because the abovementioned third-party names their identification attributes as identity instead of id?

@pleku
Copy link
Contributor

pleku commented Jan 8, 2021

I'm not sure if I understand what is the latest question, but..

That seems OK for me - I don't necessarily use TemplateModel.

If you don't use TemplateModel and instead go for LitTemplate and bind manually to the id-mapped component/elements attributes/properties, you can decide which parts of the bean you bind and how you convert things. But I'm not sure if I get exactly what is tried to achieve here, I think it is converting a property of List<BigDecimal> to something the client understands and this could be for instance done as Element::setPropertList where the BigDecimal is converted to a String or Double.

@pleku
Copy link
Contributor

pleku commented Feb 11, 2021

Closing the issue due to inactivity and since it seems like it was a question instead of an bug or enhancement issue.

Please create a new issue if something is broken/missing with specifics on what you're trying to achieve, thanks.

@pleku pleku closed this as completed Feb 11, 2021
OLD Vaadin Flow bugs & maintenance (Vaadin 10+) automation moved this from Needs triage to Closed Feb 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants