This works for me (using GWT 2.1):
ui.xml:
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
<g:HTMLPanel>
<g:Label text="test" />
</g:HTMLPanel>
</ui:UiBinder>
widget:
public TestView() {
initWidget(uiBinder.createAndBindUi(this));
getWidget().getElement().setId(DOM.createUniqueId());
System.out.println(getWidget().getElement().getId());
}
This produces type inference gwt-uid-#, where # is an arbitrary number.
Is the rest of your code working? It often happened that I had a typo or the like in a file ui.xmlthat did not cause visible errors (i.e. No stacktrace), but still was erroneous.
z00bs source
share