1

I am trying to create a right click context menu in xpage, Even I have build one using the jQuery.

Just want an idea if I can make it using any xpage functionality for example with extention library Pop up Menu,

If I say extention library Pop up Menu, Then I am very new for that, I have newer used the pop up menu,

I have tried couple of things to open the pop up on click as similarly we can easily open the dialog box, but pop up box never pops out.I would be very thankful if any any one guide me for both these things.

  1. Idea for the right click context menu using extention library
  2. Handle pop up menu onclick.

the extention library Pop up Menu which I have tried is

Code:

  <xe:popupMenu id="popupMenu1">
  <xe:this.treeNodes>
    <xe:basicContainerNode label="abc">
        <xe:this.children>
            <xe:basicLeafNode label="1"></xe:basicLeafNode>
            <xe:basicLeafNode label="2"></xe:basicLeafNode>
            <xe:basicLeafNode label="3"></xe:basicLeafNode>
            <xe:basicLeafNode label="4"></xe:basicLeafNode>
        </xe:this.children>
    </xe:basicContainerNode>
        <xe:basicContainerNode label="efg">
        <xe:this.children>
            <xe:basicLeafNode label="1"></xe:basicLeafNode>
            <xe:basicLeafNode label="2"></xe:basicLeafNode>
            <xe:basicLeafNode label="3"></xe:basicLeafNode>
            <xe:basicLeafNode label="4"></xe:basicLeafNode>
        </xe:this.children>
    </xe:basicContainerNode>
    </xe:this.treeNodes></xe:popupMenu>
    <xp:button value="PopUp" id="button1">
    <xp:eventHandler event="onclick" submit="false">
        <xp:this.script><![CDATA[XSP.openMenu("#{id:popUp1}");]]>  </xp:this.script>
     </xp:eventHandler></xp:button>
Ajit Hogade
  • 1,072
  • 9
  • 29

1 Answers1

1

There's an example for this in the XPagesEXt.nsf example application that is part of the Extension Library. This is the code you need to use for your button in order for the popupMenu to work:

<xp:button value="PopUp1" id="button1">
    <xp:eventHandler event="onclick" submit="false">
        <xp:this.script>
            <![CDATA[
                XSP.openMenu(thisEvent,#{javascript:getComponent('popupMenu1').getMenuCtor()})
        ]]></xp:this.script>
    </xp:eventHandler>
</xp:button>

As for the right-click scenario, that's not something I've looked at before.

This article by Mark Roden may be of assistance though: http://xomino.com/2013/08/18/extjs-in-xpages-16-right-click-context-menus/

Brian Gleeson - IBM
  • 2,565
  • 15
  • 21
  • Yes , right click context menu is expected in Ext Lib, It would be really a great feature if we have it in ext Lib.. – Ajit Hogade Nov 05 '15 at 04:24