mvysny / karibu-dsl

Kotlin Vaadin extensions and DSL

Home Page:http://www.vaadinonkotlin.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ClassCastException in Panel.isExpanded

DALDEI opened this issue · comments

Cause: "Dont Do That / PEBCAK Error"
try to set isExpanded in a panel
DashboardView.kt


class DashboardFrame : Panel() {
  lateinit var view : DashboardView
  val viewPlaceholder = cssLayout {
    primaryStyleName = "valo-content"; setSizeFull(); isExpanded = true   //// LINE 100
    addStyleName("v-scrollable")
  }
java.lang.ClassCastException: nexstra.portal.dashboard.DashboardFrame cannot be cast to com.vaadin.ui.AbstractOrderedLayout

com.github.vok.karibudsl.ComponentContainerKt.setExpandRatio(ComponentContainer.kt:74)
com.github.vok.karibudsl.ComponentContainerKt.setExpanded(ComponentContainer.kt:83)
nexstra.portal.dashboard.DashboardFrame$viewPlaceholder$1.invoke(DashboardView.kt:100)

Thanks! I've added a proper error message explaining the situation. Please review associated git commit whether the message is OK :)