因为我要显示含有大量文字的页面,我想预先格式化自己的文本文件,我做了以下内容:插入控件成纯HTML代码
execute: onModuleLoad()
- make an Async call to the server and load
the text files which are html-formatted
代码如下所示:
homeAsync.load(new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
contentHome.add(new HTML("<h1>FAIL</h1>something went wrong"));
caught.printStackTrace();
}
public void onSuccess(String result) {
contentHome.getElement().setId("inner");
contentHome.add(new HTML(result));
//RootPanel.get("content").add(new HTML(result));
}
});
现在..里面的文本文件是一些定制标签:
<!graph>
我婉用一些GWT小部件替换。我的问题是,我只是不知道如何轻松完成。
我可以做一个变通,如:
- load text part 1 (async call)
- insert graph for part 1
- load text part 2 (asynca call)
- insert foobar
- and so on ..
我甚至不知道这是否会工作,但说实话..这简直是太丑陋了^^
什么建议吗?
与UI粘结剂合作? – 2013-03-15 18:31:09
不,我认为这与我的问题^^没有任何关系 – displayname 2013-03-15 18:34:16