我认为这是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