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

Getting a UIDetachedException: Cannot set the push mode for a detached UI error #6

Open
eoliphan opened this issue Sep 7, 2014 · 0 comments

Comments

@eoliphan
Copy link

eoliphan commented Sep 7, 2014

Hi, I'm trying to run this with Play 2.2.3 and Vaadin/Scaladin/etc as follows

"com.vaadin" % "vaadin-server" % "7.3.0",
"com.vaadin" % "vaadin-client-compiled" % "7.3.0",
"com.vaadin" % "vaadin-themes" % "7.3.0",
"org.vaadin.addons" % "scaladin" % "3.0.0",
"org.vaadin.playintegration" %% "play-vaadin-integration" % "0.1-SNAPSHOT"

I ran into one issue where in VaadinSupport.onRouteRequest, I was always getting a 404 for my Vaadin app page. Upon investigation, it appeared that super.onRouteRequest was returning a Some for the 404, as opposed a None which would have triggered the code in the orElse. I hacked it by creating my own VaadinSupport and putting the check for a Vaadin page/app first

abstract override def onRouteRequest(request: RequestHeader): Option[Handler] = {
  val serveStatic = Play.current.configuration.getBoolean("vaadin.serve_static_resources") getOrElse true
if (serveStatic && request.path.startsWith("/VAADIN/")) {
  Option(controllers.Assets.at("/VAADIN", request.path.split("/VAADIN/")(1)))
} else onVaadinRequest(request) orElse super.onRouteRequest(request)
}
def onVaadinRequest(request: RequestHeader): Option[Handler] = {

val mappingOption = mappings find {
  request.path startsWith _._1
}
mappingOption map { m => Action {
  m._2.handleRequest(_)
}
}

}

So that worked in that my onVaadinRequest now finds my app in the mappings and attempts to handle it. I'm now getting this exception. And I've no idea what Vaadin is unhappy about

[ServiceException: com.vaadin.ui.UIDetachedException: Cannot set the push mode for a detached UI]

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

1 participant