I am just getting started with GWTQuery, and am trying to wrap my head around the load() function. Consider:
public void onModuleLoad() {
SimplePanel sp = new SimplePanel();
sp.getElement().setId("stuff");
RootLayoutPanel root = RootLayoutPanel.get();
root.add(sp);
$("#stuff").load("/hello.html");
}
If I run the above, the empty div
block for the SimplePanel element gets replaced with the contents of hello.html
. In other words, it ends up in the body
block, and the div
disappears from the DOM. What I want is for the div
block to contain hello.html
. I worked around this by putting another temporary SimplePanel
as the child of div id="stuff"
, and calling load()
on that. It works as desired. But I get the feeling I am missing something fundamental. Is there a way to do this without the throwaway SimplePanel
?