我認爲這是Tab容器中的一個錯誤...這是一個Tab容器中的錯誤嗎?
使用Java或服務器端打開新選項卡JavaScript新建選項卡包含設置爲指向另一個XPage的iframe的面板時的JavaScript createTab方法在同一個數據庫中總是會導致XPage在加載大約五個或六個選項卡後重新加載(在Chrome中,IE確實相同,但需要更多選項卡......)
如果選項卡包含指向另一個的iframe保存XPage的數據庫工作正常。
SSJS代碼是: getComponent("djTabContainer1").createTab({title:"New tab"});
;
的Java代碼
public static boolean createTab(UIDojoTabContainer tabContainer) {
try {
if (tabContainer == null) {
tabContainer = (UIDojoTabContainer) Utils.findComponent("TabContainer");
if (tabContainer == null) {
return false;
}
}
String tabTitle = null;
String url = null;
String unid = null;
UIDojoTabPane newTab = null;
// get default number from current project preferences
tabTitle = "My Tabpage";
url = Utils.GetXpageURL("tabpage.xsp");
// create a new Tab
newTab = new UIDojoTabPane();
newTab.setTitle(tabTitle);
newTab.setTabUniqueKey(new Random().toString());
newTab.setClosable(true);
newTab.setId("TabContainer_" + unid);
newTab.setStyleClass("myTabContainer");
Utils.WriteToConsole("setting style class on " + newTab.getTitle());
// newTab.setStyle("height:auto;width:auto; overflow-y: auto;border: 0px;");
// create new Panel
UIPanelEx newPanel = new UIPanelEx();
newPanel.setId("IFrame" + unid);
newPanel.setStyleClass("iframeClass");
// make an iFrame of this panel with our URL as src
newPanel.setTagName("iframe");
Attr property = new Attr();
property.setName("src");
property.setValue(url);
newPanel.addAttr(property);
// add Panel to our new Tab
newTab.getChildren().add(newPanel);
// add the new tab to our tab container
tabContainer.getChildren().add(newTab);
tabContainer.setSelectedTab(unid);
return true;
} catch (Exception ex) {
Utils.WriteToConsole("Unable to add a new Tab Page to the Tab Container (com.tlcc.Main.createTab)", ex);
return false;
}
}
是在iframe的src屬性引用XPage上是非常基本的...
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:button
value="Label"
id="button1">
</xp:button>
<xp:inputText id="inputText1"></xp:inputText></xp:view>
當XPage中重新加載它沒有更多的標籤(除了在開始時在XPage中創建的第一個選項卡)並且沒有響應。
Howard
每個幾乎肯定是在正確的軌道在這裏。 「當前XPage」的定義也可能是一個因素。當你最初加載父XPage時,這將是當前頁面。但是如果你在iFrame中加載另一個XPage,我認爲iFrame中的XPage被認爲是當前頁面,在這種情況下,父頁面的持久化方法將變爲在磁盤上,就好像你已經從父項頁面添加到iFrame頁面。 –
這似乎在我的測試用例數據庫中。明天將嘗試「真正」的應用程序。謝謝Per !!!! – Howard