因爲我要顯示含有大量文字的頁面,我想預先格式化自己的文本文件,我做了以下內容:插入控件成純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