• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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()
at com.google.gwt.user.client.ui.UIObject.getElement(UIObject.java:512)

Update:

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
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic