I want to add a widget from one html to another html using RootPanel onlyin onemodule otherwise i need to maintain state between two html
这是一个html的入口点
public void onModuleLoad() {
Button button=new Button("click me");
button.addClickHandler((ClickHandler) this);
RootPanel rootPanel=RootPanel.get("id_html1");
rootPanel.add(button);
}
这是另一个html我想在这里使用RootPane
添加这个小部件public void onClick(ClickEvent event) {
String url="http://localhost:9090/HelloWorld/"+"HelloWorld2.html";
Window.open(url, "_blank", "");
Button button=new Button("finish it!");
//button.addClickHandler((ClickHandler) this);
RootPanel rootPanel=RootPanel.get("id_html2");
rootPanel.add(button);