title: GWT : Using "UIObject" in another widget's UI.xml file
body: <p>I have defined a <code>UiBinder</code> widget called <em>Header</em> with HTML markup only in <em>Header.ui.xml</em> Hence its corresponding <em>Header.java</em> class extends <code>UIObject</code> and has <code>setElement(uiBinder.createAndBindUi(this))</code> in its constructor. This gives out an <code>Element</code> object. When appended to <code>RootPanel.geBodyElement()</code> ,  It runs fine.</p>
  
  <p><strong>Problem is:</strong></p>
  
  <p>I want to use it in another UiBinder widgets's declarative ui.xml ( type is <code>Composite</code> with GWT Ui elements in xml) file. When I use the header widget in xml here:</p>
  
  <pre><code>&lt;g:HTMLPanel&gt;
      &lt;app:Header /&gt;
  &lt;/g:HTMLPanel&gt;
  </code></pre>
  
  <p>GWT gives an error:  <em>[ERROR] Not allowed in an HTML context Element </em> </p>
  
  <p>Can any one help ?</p>