Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

When do we need to call Composite.initWidget in a GWT App?

author and cow tipper
Posts: 5000
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm messing around with GWT, and as I test deeper waters, I'm seeing an exception about not calling initWidget. I've seen that Ryan Dewsbury in his book Google Web Toolkit Applications occasionally calls this method, but I'm not sure of the reasoning.

When is it necessary to call the initWidget method, and is it always a parent calling it on a child widget or something?

java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement()


So, I had a Composite panel going on my EntryPoint. The composite panel had a VerticalPanel and a Grid widget. Apparently, I needed to call initWidget on the first widget that was going to act as a container on the page, which was the Grid. That then made my error go away.

-Cameron McKenzie
    Bookmark Topic Watch Topic
  • New Topic