Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some of the answers above already solve your issue, but I guess the reason why you had the problem in the first place is because you are confusing GWT Widgets with HTML Elements. This can cause you a lot of headaches if you don't get it right.</p> <p>The crux of the issue is that your website will always consist of HTML elements, which you can edit by modifying your main .html page, creating GWT widgets and adding them to other widgets or panels, manually writing the innerHTML of existing elements, etc. CSS will also be applied to these elements as expected.</p> <p>So what about GWT widgets? Well, they are basically units of code that wrap an underlying element, either creating it or wrapping an existing one. These wrappers work at a higher level than plain elements, let's say at a logical level. They thus have their own logical hierarchy which might differ from the HTML hierarchy. </p> <p>For instance, imagine you add a Label to a HorizontalPanel. Logically the label is a child of the panel, and it will be removed if you call clear. Now, if you go deeper into the DOM structure you will actually find a &lt; table > element (wrapped by the panel) which has a &lt; tr > element, which in turn has a &lt; td > element, which in turn has a &lt; div > element (wrapped by the label), which in turn has your label text. See how the hierarchies are different? </p> <p>So, to go back to your actual issue: RootPanel.get().clear(); will remove any logical child in the GWT widget hierarchy, nothing in your case, since you added your button to a different panel ("sendButtonContainer"). The fact that in the HTML hierarchy sendButtonContainer might be a child element of the main RootPanel is irrelevant and independent. You can of course eliminate everything as somebody said by doing RootPanel.get().getElement().setInnerHTML(""); which works at the dom level. Your widgets may even still exist and be accessible, they will just not be on the document.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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