xpages - Is this a bug in the Tab Container? -
i think bug in tab container...
opening new tab using java or server side javascript createtab method when new tab contains panel set iframe pointing xpage in same database cause xpage reloaded after loading 5 or 6 tabs (in chrome, ie same takes more tabs...)
if tab contains iframe points database holds xpage works fine.
the ssjs code is: getcomponent("djtabcontainer1").createtab({title:"new tab"});
;
the java code
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; // default number current project preferences tabtitle = "my tabpage"; url = utils.getxpageurl("tabpage.xsp"); // create 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 iframe of panel our url src newpanel.settagname("iframe"); attr property = new attr(); property.setname("src"); property.setvalue(url); newpanel.addattr(property); // add panel our new tab newtab.getchildren().add(newpanel); // add new tab our tab container tabcontainer.getchildren().add(newtab); tabcontainer.setselectedtab(unid); return true; } catch (exception ex) { utils.writetoconsole("unable add new tab page tab container (com.tlcc.main.createtab)", ex); return false; } }
the xpage referenced in src property of iframe basic...
<?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>
when xpage reloads has no more tabs (except first tab created in xpage @ start) , not responsive.
howard
it server page persistence/component tree limit problem. if use default server page persistence, server stores 4 pages in memory (per user).
when create new tabs on page loads xpage, server filling server page persistence queue , when hit 5th tab, current page no longer part of server page persistence (the component tree no longer in memory) leading reload of current page.
you can increase number of pages stored (and move disk persistence instead of memory persistence). can set viewstate "nostate" on xpage load in iframe (at least test out theory).
see toby samples blog post on state , answer on similar state issue: https://stackoverflow.com/a/31431917/785061
Comments
Post a Comment