0
votes

I am trying to call the popupMenu from a link within a datatable using the following clientSide code

 XSP.openMenu(thisEvent,'{javascript:getComponent("popupMenuNew").getMenuCtor()}');

but when ever i click on the link it just take me to the top of thesame pages, i notice it does not recognise the cleintside code as a link. Its there any other way i could call the popupMenu from XPages link?

The link is in a data table with some boostrap table attribute:

   <xp:this.attrs>
        <xp:attr name="data-toggle" value="table"></xp:attr>
        <xp:attr name="data-show-columns" value="true"></xp:attr>
        <xp:attr name="data-mobile-responsive" value="true"></xp:attr>
        <xp:attr name="data-check-on-init" value="true"></xp:attr>
   </xp:this.attrs>

the complete link code:

<xp:link escape="true" id="link1"
                    title="Create Document">
                    Neu&#160;
    <xp:this.rendered><![CDATA[#{javascript:if (rowDataEntry.isDocument()){
return true;
}  
else{
return false;
}}]]></xp:this.rendered>
    <xp:image id="image4" url="/actExpand.gif"></xp:image>
    <xp:eventHandler event="onclick" submit="false"
                        id="eventHandler2">
        <xp:this.script><![CDATA[var url = XSP.openMenu(thisEvent,'#{javascript:getComponent("popupMenuNew").getMenuCtor()}');
    var l = window.location;
    if (url != l) {
        window.location.replace(url);
    }


]]></xp:this.script>
    </xp:eventHandler>
</xp:link>
1
Please add the code for your entire XPages link control - Per Henrik Lausten

1 Answers

1
votes

XSP.openMenu() does not require a reload of the page so try this instead:

<xp:link escape="true" id="link1" title="Create Document">
    Neu&#160;
    <xp:this.rendered>
        <![CDATA[#{javascript:
            if (rowDataEntry.isDocument()){
                return true;
            } else {
                return false;
            }
        }]]>
    </xp:this.rendered>
    <xp:image id="image4" url="/actExpand.gif"></xp:image>
    <xp:eventHandler event="onclick" submit="false" id="eventHandler2">
        <xp:this.script>
            <![CDATA[XSP.openMenu(thisEvent,'#{javascript:getComponent("popupMenuNew").getMenuCtor()}');]]>
        </xp:this.script>
    </xp:eventHandler>
</xp:link>