Hi,
I am new to zimlet development. I am trying to develop a content zimlet, the issue I am facing is that I am not able to get hold of content text in the context menu handler code (the menuItemSelected function of javascript).
Here is my zimlet xml code :-
And here is my javascript code :-Code:<zimlet name="com_myservice_zimbra_click2call" version="1.0" description="Click to call any number using myservice - 12"> <include>com_myservice_zimbra_click2call.js</include> <handlerObject>com_myservice_zimbra_click2call_HandlerObject</handlerObject> <contentObject type="phone"> <matchOn> <regex attrs="g">\+?\b\d([0-9\(\)\.\s\-]){8,20}\d\b</regex> </matchOn> <contextMenu> <menuItem label="Click to call using myservice!" icon="Search" id="SOME_MENU_ITEM_ID1"/> </contextMenu> </contentObject> </zimlet>
Please note that to me looks like there is a bug in documentation of menuItemSelected function. As per documentation there are five arguments for menuItemSelected function but in reality there are only three i.e menuItemId, menuData and event (have a look at ZmZimletContext.prototype._handleMenuItemSelected( ) of ZmZimletContext.js). Please correct me, If my understanding is incorrect.Code:com_myservice_zimbra_click2call_HandlerObject.prototype.menuItemSelected = function(menuItemId, menuData, event) { switch (menuItemId) { case "SOME_MENU_ITEM_ID1": // How to get contentObjText where user right clicked???? break; default: // do nothing break; } };
Now my question is how do I get hold of contentObjectText on which the user right clicked? Any help in the right direction is highly appreciated.
Thanks in advance,
Amrainder


LinkBack URL
About LinkBacks

