我找到的解決方案是:
//define framedPanel for later use
private FramedPanel fupanel;
//Instantiate the widget i want to add when the option is clicked
final FileUp fileUp = new FileUp();
//Create the HtmlLayoutContainer in which add the widget later on
HtmlLayoutContainer conEnlaces = new HtmlLayoutContainer(getTablaEnlaces());
public Widget asWidget() {
if (fupanel == null) {
fupanel = new FramedPanel();
fupanel.setHeadingText("Administración");
(some other code here)
VerticalLayoutContainer p = new VerticalLayoutContainer();
conEnlaces.setWidth(Window.getClientWidth());
fupanel.add(p);
p.add(conEnlaces);
Hyperlink fileUph = new Hyperlink();
fileUph.setText("- Importación de CSV");
conEnlaces.add(fileUph, new HtmlData(".fileUph"));
filexh.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
conEnlaces.add(filex, new HtmlData(".resultado"));
}
});
fupanel.add(conEnlaces);
}
return fupanel;
}
private native String getTablaEnlaces() /*-{
return [ '<table border="0" cellspacing="0" cellpadding="0">',
'<tr><td>',
'<table border="0" width="75%">',
'<tr><td class=fileUph></td></tr>',
'</table></td>',
'<td><table border="0" style="margin-left: 25px;">',
'<tr><td class=resultado></td></tr>',
'</table>',
'</td></tr></table>'
].join("");
}-*/;
public void onModuleLoad() {
RootPanel.get().add(asWidget());
}
而且像這樣我的問題已經解決了。我向你展示了我的代碼,因爲我在使用stackoverflow論壇時生氣,人們說已經達到了解決方案,但不解釋如何。
感謝您的回覆和時間,
水平面板已經符合要求。在左邊你建立你的菜單,在右邊你放下一個你用作新的「rootpanel」的面板。不需要iframe。 你可以發佈你的代碼如何創建用戶界面? – deterministicFail
除了你的答案,我認爲它是完全有效的,我想我可以使用一個HTMLLayoutContainer,其中我會寫一個表,其中包含另外兩個表。一方面,將菜單選項的大小顯示爲列表,另一方面顯示單擊特定選項時顯示的小部件的內容。 – Catersa
我打算用我找到的解決方案回答我的問題,但是:「聲譽低於10的用戶在詢問後8小時內無法回答自己的問題,您可以回答11/21/2013 5:16:04 PM。在此之前請使用評論,或者編輯您的問題。「所以我會在8小時內發佈答案,因爲我本來打算放在第一位。感謝您的回覆和時間。 – Catersa