Skip to content

Commit

Permalink
Better fix for the previous fix :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri Kerola committed Oct 8, 2012
1 parent 8843c52 commit 5001b46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addon/src/main/scala/vaadin/scala/BeanItemContainer.scala
Expand Up @@ -22,13 +22,13 @@ class BeanItemContainer[BT](override val p: com.vaadin.data.util.BeanItemContain

def addBean(bean: BT): BeanItem[BT] = new BeanItem[BT](bean)

def wrapItem(unwrapped: com.vaadin.data.Item): Item = unwrapped match {
def wrapItem(unwrapped: com.vaadin.data.Item): Item = {
// must create BeanItem with the constructor that takes a Vaadin BeanItem not a bean.
case beanItem: com.vaadin.data.util.BeanItem[_] => new BeanItem[Any](beanItem)
new BeanItem[BT](unwrapped.asInstanceOf[com.vaadin.data.util.BeanItem[BT]])
}
}

class BeanItem[BT](override val p: com.vaadin.data.util.BeanItem[_]) extends Item {
class BeanItem[BT](override val p: com.vaadin.data.util.BeanItem[BT]) extends Item {

def this(bean: BT) {
this(new com.vaadin.data.util.BeanItem[BT](bean))
Expand All @@ -38,5 +38,5 @@ class BeanItem[BT](override val p: com.vaadin.data.util.BeanItem[_]) extends Ite
this(new com.vaadin.data.util.BeanItem[BT](bean, propertyIds.asJavaCollection))
}

val bean = p.getBean
val bean: BT = p.getBean
}

0 comments on commit 5001b46

Please sign in to comment.