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

MatchError, with Table/SQLContainer/Editable and custom cells #68

Open
fancellu opened this issue May 8, 2015 · 5 comments
Open

MatchError, with Table/SQLContainer/Editable and custom cells #68

fancellu opened this issue May 8, 2015 · 5 comments

Comments

@fancellu
Copy link

fancellu commented May 8, 2015

Looks v similar to #24

I have a Table and I set the data source via

p.setContainerDataSource(usersContainer)

usersContainer is an SQLContainer.

Now all is fine, can make it editable, save to DB. But, I now need to change one of the cells to a combo, so I try setting tableFieldFactory, but on editable=true I get a big stack trace

scala.MatchError: com.vaadin.data.util.sqlcontainer.SQLContainer@65fd0fef (of class com.vaadin.data.util.sqlcontainer.SQLContainer)
at vaadin.scala.internal.WrapperUtil$.wrapperFor(WrapperUtil.scala:13)
at vaadin.scala.Wrapper$class.wrapperFor(Wrapper.scala:9)
at vaadin.scala.AbstractComponent.wrapperFor(AbstractComponent.scala:15)
at vaadin.scala.Container$Viewer$class.container(Container.scala:161)
at vaadin.scala.AbstractSelect.container(AbstractSelect.scala:29)
at vaadin.scala.TableFieldFactoryDelegator$class.createField(FieldFactory.scala:140)
at vaadin.scala.TableFieldFactory$$anon$9.createField(FieldFactory.scala:128)
at com.vaadin.ui.Table.getPropertyValue(Table.java:4063)
at com.vaadin.ui.Table.parseItemIdToCells(Table.java:2356)
at com.vaadin.ui.Table.getVisibleCellsNoCache(Table.java:2195)
at com.vaadin.ui.Table.refreshRenderedCells(Table.java:1717)
at com.vaadin.ui.Table.refreshRowCache(Table.java:2661)
at com.vaadin.ui.Table.setEditable(Table.java:4786)

If I don't go editable OR don't mess with tableFieldFactory, its fine, but I need to do both.

In fact I do both elsewhere in my app, but container is standard inmemory IndexedContainer, and not SQLContainer.

Any idea of a way around this?

Thanks.

@fancellu
Copy link
Author

fancellu commented May 9, 2015

Well, I found a way around this, just use a plain Vaadin Table. Not exactly ideal, but does show that what I'm trying to do isn't unreasonable.

@fancellu
Copy link
Author

If this could be fixed it would be really nice, currently by code is littered with Java level hacks.

Thanks.

@henrikerola
Copy link
Owner

So the problem is that your are using the Vaadin SQLContainer because there is no a Scaladin wrapper for the SQLContainer?

@fancellu
Copy link
Author

Yep. In the main it works fine, but as I said, in certain circumstances will go bang with a match error

@rpiaggio
Copy link
Contributor

rpiaggio commented Aug 5, 2015

+1 please

getItem fails on a Table with a SQLContainer as data source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants