• Popup Menu not working

    By Chintan Parekh 1 decade ago

    I am trying to open popup menu using client side javascript XSP.openMenu(id:"xyz") but it does nothing..when used a debugger i get this error: menuCtor is not a function 

    Same thing works fine with pure dojo code instead of the extension library control.

    Also the dialogbox control works fine with the same command XSP.openDialog()..

    Awaiting a reply.. 

    • Can you please attach a sample db?

      By Philippe Riand 1 decade ago

      need that to understand the problem

    • Code

      By Chintan Parekh 1 decade ago

      Thank you for the reply.

      Here is a sample code:

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      <xp:view xmlns:xp="http://www.ibm.com/xsp/core"
      
      xmlns:xe="http://www.ibm.com/xsp/coreex">
      
       
      
      <xp:button value="openDialog" id="button1">
      
      <xp:eventHandler event="onclick" submit="false">
      
      <xp:this.script><![CDATA[XSP.openDialog("#{id:dialog1}");]]></xp:this.script>
      
      </xp:eventHandler></xp:button>
      
      <xp:button value="openMenu" id="button2">
      
      <xp:eventHandler event="onclick" submit="false">
      
      <xp:this.script><![CDATA[XSP.openMenu("#{id:popupMenu1}");]]></xp:this.script>
      
      </xp:eventHandler></xp:button>
      
      <xp:br></xp:br><xe:popupMenu id="popupMenu1">
      
      <xe:this.treeNodes>
      
      <xe:basicContainerNode label="A">
      
      <xe:this.children>
      
      <xe:basicLeafNode label="B"></xe:basicLeafNode>
      
      <xe:basicLeafNode label="C"></xe:basicLeafNode>
      
      </xe:this.children>
      
      </xe:basicContainerNode>
      
       
      
      <xe:basicLeafNode label="d"></xe:basicLeafNode>
      
      </xe:this.treeNodes>
      
      </xe:popupMenu>
      
      <xe:dialog id="dialog1">abcd</xe:dialog></xp:view>
      
       
      

      So, the dialog box functions fine but popupMenu does not open. Am I doing it wrong?

       

    • Thanks,this is a regression

      By Philippe Riand 1 decade ago

      It had been introduced Feb 12th by a confusion of the renderers to use, and unfortunately our automated tests didn't catch it. I submitted a fix that will be in the next build.

      Also, look at the demo DB on how to display a menu. the XSP.openMenu function has 2 parameters, and your code should be like:

       

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

      But you need the fix. I hope we'll provide a new build early next week.

      • Thank you

        By Chintan Parekh 1 decade ago

        Thank you so much..

        Would be waiting for the fix then..!