I want to add actions dynamically in PlaceBar (extlib oneui application layout).
We have couple of urls stored in some configuration documents. Based on these URLs I want to create Container node having Basic Child nodes in it. Every child node use one URL from list. How I can create container node and add child nodes to it dynamically? any sample SSJS/Java/CSJS code for this?
Thank you..
Have a look at the Repeat Node (xe:repeatTreeNode
) which is described in the XPages Extension Library book on page 245.
Here's a very simple example (taken directly from the book):
<xe:repeatTreeNode var="val">
<xe:this.value>
<![CDATA[#{javascript:return [
["Home","home"],
["Domino","domino"],
["OneUI","oneui"]
];}]]>
</xe:this.value>
<xe:this.children>
<xe:basicLeafNode>
<xe:this.submitValue><![CDATA[#{javascript:return val[1]}]]></xe:this.submitValue>
<xe:this.label><![CDATA[#{javascript:return val[0]}]]></xe:this.label>
</xe:basicLeafNode>
</xe:this.children>
</xe:repeatTreeNode>
Thank you for the quick reply. This is very useful information for me.
Another way I found out based on XSnippet code and some reverse engg. from java code in xpage as follow :
var oneui = getComponent("applicationLayout1");
var uiConfig = oneui.getConfiguration();
var containerNode:com.ibm.xsp.extlib.tree.complex.ComplexContainerTreeNode = new com.ibm.xsp.extlib.tree.complex.ComplexContainerTreeNode();
containerNode.setLabel("Cluster Applications");
var docAppProfile = docColl.getFirstDocument();
while(docAppProfile != null)
{
var children:com.ibm.xsp.extlib.tree.complex.ComplexLeafTreeNode = new com.ibm.xsp.extlib.tree.complex.ComplexLeafTreeNode();
children.setComponent(oneui);
children.setLabel(docAppProfile.getItemValueString("appTitle"));
children.setHref(docAppProfile.getItemValueString("appURL"));
children.setImage(docAppProfile.getItemValueString("appLogoThumb"));
containerNode.addChild(children);
children = null;
var tempDoc = docColl.getNextDocument(docAppProfile);
docAppProfile = null;
docAppProfile = tempDoc;
}
uiConfig.addPlaceBarAction(containerNode);
This is sample code only. Converted this is into java code and serialized to improve performance and load it only once in application.
Thank you again for help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With