Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately, IIRC you can't set an id for a Widget in UiBinder's code (I think you can only for normal HTML). So you are left with setting the correct id via <code>someWidget.getElement().setId()</code> (like you did in the code above).</p> <p>What's missing now, I think, is a placeholder (a div, span, whatever) with the correct id in the <code>HTMLPanel referencePanel</code>, like so:</p> <pre><code>&lt;g:HTMLPanel ui:field="referencePanel"&gt; &lt;div ui:field="referencePanelInner" /&gt; &lt;/g:HTMLPanel&gt; </code></pre> <p>And in <code>AppUIDemo</code>:</p> <pre><code>@UiField DivElement referencePanelInner; // ... public AppUIDemo() { // ... referencePanelInner.setId(reference.getRefPanelId()); } </code></pre> <p>...unless you want to add the ReferenceUI directly into <code>referencePanel</code> - in which case you should just use a <code>FlowPanel</code> :)</p> <p>PS: IMHO, you should generate and set the unique id for the <code>ReferenceUI.refPanel</code> from the <code>ReferenceUI</code> class (and expose the id) - that way you don't mess with the widget's "internals" from some external widgets.</p> <hr> <p>OK, I think I got it. The <code>IllegalStateException</code> exception is being thrown because you are adding <code>ReferenceUI.refPanel</code> (or <code>ReferenceUI.referencePanel</code>, I don't know which is the current name) to <code>AppUIDemo</code> (<code>ReferenceUI</code> obviously doesn't implement <code>HasWidgets</code>) - when you should be adding the whole <code>ReferenceUI reference</code> composite :) I don't know why you did it this way in the first place (maybe because of the whole mess with the ids), but the code should look something like this:</p> <pre><code>public AppUIDemo() { initWidget(uiBinder.createAndBindUi(this)); ReferenceUI reference = new ReferenceUI(refUIBinder); referencePanel.add(reference); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload